Closed dangh closed 6 years ago
Re-pro: https://codesandbox.io/s/ook0p3y23z
If you click on -> b with error button, the flag is locked and you cannot click on -> b button anymore.
I trace down to these methods:
In handleTransition(), this.isTransitioning is turned on https://github.com/MicheleBertoli/react-automata/blob/dbebfba07987b159670c7b9890f01a687ce2f715/src/withStateMachine.js#L152-L161
handleTransition()
this.isTransitioning
In handleComponentDidUpdate(), it supposed to be turned off but it does not because the machineState doesn't change. https://github.com/MicheleBertoli/react-automata/blob/dbebfba07987b159670c7b9890f01a687ce2f715/src/withStateMachine.js#L117-L119
handleComponentDidUpdate()
So when another transition triggered, the invariant guard yielded.
Good catch, thanks for opening this issue and providing a non-working example. @dangh. The issue is fixed in v4.0.3.
v4.0.3
Re-pro: https://codesandbox.io/s/ook0p3y23z
If you click on -> b with error button, the flag is locked and you cannot click on -> b button anymore.
I trace down to these methods:
In
handleTransition()
,this.isTransitioning
is turned on https://github.com/MicheleBertoli/react-automata/blob/dbebfba07987b159670c7b9890f01a687ce2f715/src/withStateMachine.js#L152-L161In
handleComponentDidUpdate()
, it supposed to be turned off but it does not because the machineState doesn't change. https://github.com/MicheleBertoli/react-automata/blob/dbebfba07987b159670c7b9890f01a687ce2f715/src/withStateMachine.js#L117-L119So when another transition triggered, the invariant guard yielded.