|
@@ -458,20 +458,17 @@ class App extends React.Component<AppProps, AppState> {
|
|
|
locked: false,
|
|
|
});
|
|
|
|
|
|
- const unbind = this.scene.addCallback(() => {
|
|
|
- const customElementConfig = getCustomElementConfig(
|
|
|
- this.props.customElementsConfig,
|
|
|
- customElement.customType,
|
|
|
- );
|
|
|
- if (customElementConfig && customElementConfig.onCreate) {
|
|
|
- customElementConfig.onCreate(customElement);
|
|
|
- }
|
|
|
- });
|
|
|
this.scene.replaceAllElements([
|
|
|
...this.scene.getElementsIncludingDeleted(),
|
|
|
customElement,
|
|
|
]);
|
|
|
- unbind();
|
|
|
+ const customElementConfig = getCustomElementConfig(
|
|
|
+ this.props.customElementsConfig,
|
|
|
+ customElement.customType,
|
|
|
+ );
|
|
|
+ if (customElementConfig && customElementConfig.onCreate) {
|
|
|
+ customElementConfig.onCreate(customElement);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
private renderCanvas() {
|