0

I am trying to have a custom week view as per https://github.com/jquense/react-big-calendar/blob/master/examples/demos/customView.js.

In that example, they have taken a custom number of days as 3. I want to have it dynamic (by keeping state variable). I am planning to change the state variable based on the screen size. (I have put the window width event listener to update that state variable)

Now the problem is how can I access that state variable inside the navigate and title static functions? Because they will be custom based on the no of days.

Sanket Patel
  • 541
  • 6
  • 12

1 Answers1

0

If the custom view was a React function component, and your state value was defined in a wrapping context, you could use hooks, and use a custom context hook inside the custom week view component for access to the state value.

Steve -Cutter- Blades
  • 5,057
  • 2
  • 26
  • 40