Skip to content

The chart should be destroyed on unmount #34

@archfz

Description

@archfz

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. Related #20

diff --git a/node_modules/react-frappe-charts/build/index.js b/node_modules/react-frappe-charts/build/index.js
index 6b82382..0df800e 100644
--- a/node_modules/react-frappe-charts/build/index.js
+++ b/node_modules/react-frappe-charts/build/index.js
@@ -20,6 +20,7 @@ const ReactFrappeChart = forwardRef((props, parentRef) => {
                 onDataSelect(e);
             });
         }
+        return () => chart.current.destroy();
     }, []);
     React.useEffect(() => {
         if (initialRender.current) {

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