mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
don't use addCallback for triggering onCreate
This commit is contained in:
parent
645f9a5dc0
commit
c93d8f4bd0
1 changed files with 7 additions and 10 deletions
|
@ -458,7 +458,10 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
locked: false,
|
locked: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const unbind = this.scene.addCallback(() => {
|
this.scene.replaceAllElements([
|
||||||
|
...this.scene.getElementsIncludingDeleted(),
|
||||||
|
customElement,
|
||||||
|
]);
|
||||||
const customElementConfig = getCustomElementConfig(
|
const customElementConfig = getCustomElementConfig(
|
||||||
this.props.customElementsConfig,
|
this.props.customElementsConfig,
|
||||||
customElement.customType,
|
customElement.customType,
|
||||||
|
@ -466,12 +469,6 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
if (customElementConfig && customElementConfig.onCreate) {
|
if (customElementConfig && customElementConfig.onCreate) {
|
||||||
customElementConfig.onCreate(customElement);
|
customElementConfig.onCreate(customElement);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
this.scene.replaceAllElements([
|
|
||||||
...this.scene.getElementsIncludingDeleted(),
|
|
||||||
customElement,
|
|
||||||
]);
|
|
||||||
unbind();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private renderCanvas() {
|
private renderCanvas() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue