Fix the bug where react would complain if SnapshotEditor is unmounted

This commit is contained in:
Aria Minaei 2023-08-05 09:59:43 +02:00
parent e153c4cbbb
commit af1964f9ac

View file

@ -150,7 +150,10 @@ const r3fExtension: IExtension = {
root.render(React.createElement(SnapshotEditor, {paneId}))
function unmount() {
// gotta unmount in the next tick, otherwise react will complain https://github.com/facebook/react/issues/25675
setTimeout(() => {
root.unmount()
}, 0)
}
return unmount
},