mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-06-29 07:21:23 +02:00
dispose editor controls on unmount
This commit is contained in:
parent
1de8d84e36
commit
278a3a6c0a
|
@ -34,6 +34,10 @@ class DoodlePreview extends React.Component {
|
||||||
this.editorControls.addEventListener('change', () => scene.render());
|
this.editorControls.addEventListener('change', () => scene.render());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
if (this.editorControls) this.editorControls.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
const { scene } = this.state;
|
const { scene } = this.state;
|
||||||
const { width, height } = this.props;
|
const { width, height } = this.props;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user