diff --git a/src/components/ReactDiagramEditor.js b/src/components/ReactDiagramEditor.js index 1098ac0..b0d86de 100644 --- a/src/components/ReactDiagramEditor.js +++ b/src/components/ReactDiagramEditor.js @@ -139,7 +139,7 @@ export default function ReactDiagramEditor({ console.log('ERROR:', err); } - diagramModelerState.on('import.done', (event) => { + function onImportDone(event) { const { error } = event; if (error) { @@ -158,7 +158,9 @@ export default function ReactDiagramEditor({ if (modeler.constructor.name === 'Modeler') { modeler.get('canvas').zoom('fit-viewport'); } - }); + } + + diagramModelerState.on('import.done', onImportDone); function displayDiagram(diagramModelerToUse, diagramXMLToDisplay) { if (alreadyImportedXmlRef.current) {