From 6eb0cf6a108d6e096a2c3474f87af78886a1d3ef Mon Sep 17 00:00:00 2001 From: ad1992 Date: Wed, 20 Apr 2022 11:48:22 +0530 Subject: [PATCH] unbind onCreate once executed --- src/components/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 9003f8ff3..c329648ca 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -453,7 +453,7 @@ class App extends React.Component { height, }); - this.scene.addCallback(() => { + const unbind = this.scene.addCallback(() => { const customElementConfig = getCustomElementConfig( this.props.customElementsConfig, customElement.customType, @@ -466,6 +466,7 @@ class App extends React.Component { ...this.scene.getElementsIncludingDeleted(), customElement, ]); + unbind(); }; private renderCanvas() {