From 46f5ce5ce0520bbab3efbc5107658d037c23baf8 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Fri, 29 Jul 2022 17:25:26 +0530 Subject: [PATCH] fix: useLayout effect cleanup in dev mode for charts (#5505) --- src/components/PasteChartDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PasteChartDialog.tsx b/src/components/PasteChartDialog.tsx index fb024e8d3..bb5bfc571 100644 --- a/src/components/PasteChartDialog.tsx +++ b/src/components/PasteChartDialog.tsx @@ -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]);