You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a child machine has a top-level exit action, this action will be triggered twice when the child machine ends in a final state that triggers an escalate action.
Basically a child machine like this one will trigger exit action twice when reaching final cancelled state.
constchildMachine=createMachine({predictableActionArguments: true,id: "child",initial: "start",entry: ()=>{console.log('child-entry')},exit: ()=>{// <-- triggered twice when reaching final `cancelled` stateconsole.log('child-exit')},states: {start: {on: {COMPLETE: "completed",CANCEL: "cancelled"}},completed: {type: "final"},cancelled: {// <-- final cancelled statetype: "final",entry: actions.escalate({type: "cancelled"})}}});send('CANCEL')
Description
If a child machine has a top-level exit action, this action will be triggered twice when the child machine ends in a final state that triggers an escalate action.
Basically a child machine like this one will trigger exit action twice when reaching final
cancelled
state.Expected result
Actual result
Reproduction
https://codesandbox.io/s/ecstatic-euler-pqtsfj?file=/src/index.js
Additional context
4.38.2
4.32.1
, regression starts with4.33.0
and higherxstate.stop
event and fix exit handlers execution #3126The text was updated successfully, but these errors were encountered: