React scheduler executes something despite props not being updated
6 years ago.
My component looks something like this:
const Scheduler: FunctionComponent = () => {
const [counter, setCounter] = useState(2);
const [daypilotConfig, setDaypilotConfig] = useState({...})
...
const resources: DayPilot.ResourceData[] = useMemo(() => {
...
return resources;
}, [someValue])
return <>
<button onClick={()=>setCounter(counter+1)}>Increment</button>{counter}
<DayPilotScheduler {...daypilotConfig} resources={resources} />
</>
}
Even if I only click the increment-button and set the counter-state, daypilot does stuff. Among things it does is trigger a scroll-event that fetches the same events again. And there is a delay between pressing my button until the value updates and I guess this is due to the scheduler re-calculates some stuff.
My original problem is when pressing an event in the scheduler and wanting to pop up a modal, I have to set the state setShowModal(true) but there is too much delay before the modal is showing.
Is there anything I can do to avoid this or is there something in the react-scheduler-component ?
DayPilot