mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add onCreate in customElementConfig
This commit is contained in:
parent
4e75f10b2c
commit
ba48aa24a0
4 changed files with 48 additions and 28 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue