Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route-changed event triggered after xstate.init on the same route #26

Open
joernroeder opened this issue Sep 2, 2020 · 3 comments
Open
Labels
bug Something isn't working

Comments

@joernroeder
Copy link
Contributor

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 was xstate.init.

@joernroeder 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
@carloslfu carloslfu added the bug Something isn't working label Sep 6, 2020
@carloslfu
Copy link
Owner

Thanks, @joernroeder.

@zchbndcc9
Copy link

zchbndcc9 commented Mar 12, 2021

Any updates on this?

@redbar0n
Copy link

redbar0n commented Dec 7, 2022

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants