mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 14:00:56 +02:00
Add onCreate in customElementConfig
This commit is contained in:
@@ -452,6 +452,16 @@ class App extends React.Component<AppProps, AppState> {
|
||||
width,
|
||||
height,
|
||||
});
|
||||
|
||||
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,
|
||||
|
Reference in New Issue
Block a user