Skip to content

Commit

Permalink
#2912 fix react warnning
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlaStarla committed Aug 7, 2023
1 parent 2282c06 commit f9027b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ketcher-react/src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ function Editor(props: EditorProps) {
window.dispatchEvent(ketcherInitEvent);
}
});
return () => appRoot.unmount();
return () => {
// setTimeout is used to disable the warn msg from react "Attempted to synchronously unmount a root while React was already rendering"
setTimeout(() => {
appRoot.unmount();
});
};
// TODO: provide the list of dependencies after implementing unsubscribe function
}, []);

Expand Down

0 comments on commit f9027b1

Please sign in to comment.