handling escalate action causes 'Maximum call stack size exceeded' #1550
-
Not sure if I am using the escalate properly, but the general idea was:
However, Am I doing something wrong? Is this not possible to do? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The problem here has nothing to do with Here's how to fix the infinite loop: const machine = Machine({
initial: "A",
states: {
A: {
invoke: {
src: childMachine,
onError: {
target: "E" // transitioning causes 'Maximum call stack size exceeded'
}
}
},
E: {
always: {
actions: (c, e) => console.log("E state", c, e),
+ target: "F"
}
},
+ F: {}
}
// ...
}); I'll add a warning for these scenarios. |
Beta Was this translation helpful? Give feedback.
The problem here has nothing to do with
escalate()
; rather, thealways
transition will always be taken in theE
state (as the name implies).Here's how to fix the infinite loop:
I'll add a warning for these scenarios.