|
const svgCanvas = React.createRef<CanvasRef>(); |
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