Closed juboba closed 4 years ago
I was passing the wrong event name, sorry ^^'
my use case is a bit different as i am building a multi-step wizard form where you have to go through in a particular order. usually I would model this with https://xstate.js.org/docs/guides/transitions.html#transient-transitions and guards but how can I model this with router transitions in mind?
If feels like adding entryConditions
to the route definition at https://github.com/carloslfu/xstate-router/blob/master/src/index.tsx#L85 could work. entry/exit
conditions per route (compared to the existing route-changed
) could be cool in general.
I'm trying to do something like:
But even though the event is emitted it does not transition the machine to the 'test' state.
The purpose of this is to prevent the user from entering the Private area if there is no valid token.