Problem tying to reset the state machine #4815
Replies: 3 comments
-
I can even see that my |
Beta Was this translation helpful? Give feedback.
-
I just created the following repository, where you can see it is not doing what it was expected to do https://github.com/santomegonzalo/xstate-reset-example Mar-25-2024.11-49-07.mp4 |
Beta Was this translation helpful? Give feedback.
-
is this issue happening because my state machine reached the finite state? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm pretty new to this library and so far I love it... It is solving so many of our issues.
We are currently using
@xstate/react
with the context because we need the state machine always to be running. The problem is when I'm trying toreset
the state machine to go back to theinitial
state because it is not working as expected.Some context:
We are using
To get the current state, the machine defines what screen we are showing (we are using react-native).
Simplified example of a machine:
Now, when we finish our state machine, a user presses a button, and then we
send
the eventreset
and I'm seeing the following logs:using:
and the next time a user needs to work with the state machine, the machine returns the last visited state instead of IDLE.
I'm a little lost and will appreciate the help.
Beta Was this translation helpful? Give feedback.
All reactions