Fix the bug where react would complain if SnapshotEditor is unmounted
This commit is contained in:
parent
e153c4cbbb
commit
af1964f9ac
1 changed files with 4 additions and 1 deletions
|
@ -150,7 +150,10 @@ const r3fExtension: IExtension = {
|
||||||
|
|
||||||
root.render(React.createElement(SnapshotEditor, {paneId}))
|
root.render(React.createElement(SnapshotEditor, {paneId}))
|
||||||
function unmount() {
|
function unmount() {
|
||||||
root.unmount()
|
// gotta unmount in the next tick, otherwise react will complain https://github.com/facebook/react/issues/25675
|
||||||
|
setTimeout(() => {
|
||||||
|
root.unmount()
|
||||||
|
}, 0)
|
||||||
}
|
}
|
||||||
return unmount
|
return unmount
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue