You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm noticing that route-changed events are triggered even if the machine gets initialized on that particular route. This leads to duplicate actions on state entry and invocations of services at the target route.
my suggestion is to omit the route-changed event and not trigger it if the route did not change or the previous event was xstate.init.
The text was updated successfully, but these errors were encountered:
joernroeder
changed the title
route-changed event triggered after xstate.init
route-changed event triggered after xstate.init on the same route
Sep 2, 2020
I'm noticing that
route-changed
events are triggered even if the machine gets initialized on that particular route. This leads to duplicate actions on state entry and invocations of services at the target route.I've isolated the behavior in this sandbox:
https://codesandbox.io/s/xstate-router-forked-fyff8
my suggestion is to omit the
route-changed
event and not trigger it if the route did not change or the previous event wasxstate.init
.The text was updated successfully, but these errors were encountered: