Hi. I need to implement zoomToFit feature on timeline based on min/max date event values. How do I do that? How do I pass this zoomToFIt "react way" into the config?
Support Forum
zoomToFit
is a function you need to call on the Scheduler instance. For example:
const App = props => {
// Scheduler ref forwarded to Scheduler component
const schedulerRef = useRef(null);
useEffect(() => {
schedulerRef.current.instance.zoomToFit(options);
}, [somethingThatChanged]);
// etc.
return (
<Scheduler
{...schedulerConfig}
ref={schedulerRef}
// etc.
};
Note: The above is a pseudo-code meant for explanation only; it won't work if copy&pasted.