Warning: Attempted to synchronously unmount a root while React was already rendering
Closed this issue · 3 comments
psychedelicious commented
I am getting this error when my Html
component unmounts:
react_devtools_backend.js:4045 Warning: Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.
at Html (http://localhost:5173/node_modules/.vite/deps/react-konva-utils.js?v=4835bfa9:40:15)
Victorasa21 commented
lavrton commented
It may lead to memory leaks, if you remove that.
Reyems commented
For me this cleared up the problem..
React.useEffect(() => {
return () => {
setTimeout(() => {
root.unmount();
});
};
}, []);