Closed Jfsslemos closed 2 months ago
Reentry does not apply here since you are not reentering the same (or ancestor) state.
But how could I achieve this functionality? Just to be clear, i have no parente-child state, only sibiling states. And I want transition many times to the same state during the execution in a way that every time the state execute it's entry function
Reentry does not apply here since you are not reentering the same (or ancestor) state.
But how could I achieve this functionality? Just to be clear, i have no parente-child state, only sibiling states. And I want transition many times to the same state during the execution in a way that every time the state execute it's entry function
Closing this as invalid – if you can explain your use-case a bit more, I can help you figure out a better solution. However, reentering is not related to sibling states.
XState version
XState version 5
Description
Reenter attribute doesn't work on sibiling states
Expected result
[...] states:{ state1:{ entry: console.log(''state1") on:{ '':{target: 'state2' reenter: true}, }, }, state2:{ entry: console.log(''state2") on:{ '':{target: 'state1' reenter: true}, }, }, } [...]
output: state1 state2 state1 state2 state1 state2 [...]
Actual result
output: state1 state2 and stops here, doesn't reenter in states that are not parent-child
Reproduction
i dont really know how to make those options of reproduction
Additional context
No response