Closed ejabu closed 1 week ago
With react ref :
const Timeline = () => {
const timelineRef = useRef();
const arrowsRef = useRef();
useEffect(()=>{
const container = document.getElementById("timeline-id");
timelineRef.current = new vis.Timeline(container, items, groups, options);
arrowsRef.current = new Arrow(timelineRef.current, [])
},[])
return (
<div id="timeline-id"/>
)
}
How to integrate it with react ?