vizhub-core / vite-export-template

Vite Hot Reloading Template for D3
5 stars 4 forks source link

React Component Wrapper #6

Open curran opened 1 year ago

curran commented 1 year ago

Something like this:

const [state, setState] = useState({});
const ref = useRef()
useEffect(() => {
  viz(ref.current, {state, setState});
}, [state]);
return <div ref={ref}/>;