Skip to content

exportImage(), exportSvg() fails with "Export function called before canvas loaded" #179

@dhe128

Description

@dhe128

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions