You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportSvg() sometimes throws with Export function called before canvas loaded because svgCanvas.current is null - this is due to the usage of createRef which creates a new ref every time the component is rendered.
Suggested fix: replace createRef with useRef
The text was updated successfully, but these errors were encountered:
dhe128
changed the title
Use useRef over createRef
exportImage(), exportSvg() fails with "Export function called before canvas loaded"
Dec 5, 2024
react-sketch-canvas/packages/react-sketch-canvas/src/ReactSketchCanvas/index.tsx
Line 50 in bcbb141
exportSvg()
sometimes throws withExport function called before canvas loaded
becausesvgCanvas.current
isnull
- this is due to the usage ofcreateRef
which creates a new ref every time the component is rendered.Suggested fix: replace
createRef
withuseRef
The text was updated successfully, but these errors were encountered: