I am trying to wrap FullCalendar React component with my own functional React component with useContext
hook to access MobX store (I might use the store in other components eventually) and observer()
to make it react to changes in the store. My component reacts as I would expect, but I have trouble making the FullCalendar component render after a change.
I've tried finding a solution, wrapping <FullCalendar>
in <Observer>
, playing with autorun()
and reaction()
but nothing worked. I have to be missing something
This sandbox https://codesandbox.io/s/mobx-fullcalendar-xejn9 shows a simplified version of my solution so far.
Clicking the button at the top adds an event to the observable store, which gets shown in a list below it. But the calendar doesn't show the new event. Weirdly enough if I make a change in the code, save it, the CodeSandbox causes the render and the events show up in the calendar.