Closed sehilyi closed 2 years ago
useEffect(() => { if(!gosSmRef.current) return; console.log('here'); setTimeout(() => { const { canvas } = gosSmRef.current?.api.getCanvas({ resolution: 4, transparentBackground: false }); const url = canvas.toDataURL('image/png'); // console.log(url); var image = new Image(); image.src = url; document.body.appendChild(image); }, 1000); }, [gosSmRef.current]);