1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

fix: useLayout effect cleanup in dev mode for charts (#5505)

This commit is contained in:
Aakansha Doshi 2022-07-29 17:25:26 +05:30 committed by GitHub
parent b00bd3d6c0
commit 46f5ce5ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,7 +46,7 @@ const ChartPreviewBtn = (props: {
},
null, // files
);
previewNode.replaceChildren();
previewNode.appendChild(svg);
if (props.selected) {
@ -55,7 +55,7 @@ const ChartPreviewBtn = (props: {
})();
return () => {
previewNode.removeChild(svg);
previewNode.replaceChildren();
};
}, [props.spreadsheet, props.chartType, props.selected]);