I’m not sure if that’s what you mean but since the last release (2023.4.5801), you can also use a new controlRef
prop to get a reference directly to the DayPilot.Calendar
object.
It accepts a ref or a callback so you can use it to store the reference in a state variable. The useEffect()
block will be executed when the calendar
value is set.
const [calendar, setCalendar] = useState();
useEffect(() => {
console.log("DayPilot.Calendar is available", calendar);
}, [calendar]);
return (
<DayPilotCalendar controlRef={setCalendar} />
};