bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.62k stars 1.33k forks source link

cannot read properties of undefinde (reading 'saveXML') #2229

Closed slhasadi closed 1 month ago

slhasadi commented 1 month ago

Describe the Bug

hi i use the bpmn modeler with react js and i have a problem with this when i want to save changed xml It shows me an error cannot read properties of undefinde (reading 'saveXML')

i found when i used setState in modeler.on("element.click") function this error has show and when unused this its hasnt error

Steps to Reproduce

  1. do this
  2. do that

Expected Behavior

Untitledrrrr Untitledrrrr222

Environment

nikku commented 1 month ago

This is an issue with how you embed bpmn-js into your React app. Cf. https://github.com/bpmn-io/react-bpmn for a simple example that does this properly, via refs.

slhasadi commented 1 month ago

This is an issue with how you embed bpmn-js into your React app. Cf. https://github.com/bpmn-io/react-bpmn for a simple example that does this properly, via refs.

thanks for your answer but I have some custom components and I used bpmn modeler but this repo just used bpmn viewer