-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Using match() on client causes onEnter() to be called twice on initial page load. #3016
Comments
match()
on client causes onEnter()
to be called twice on initial page load.
It's been fixed on master. |
@taion oh good. Do you know which commit? And perhaps when it would make it into an RC? |
Need a new history RC first to resolve some other bugs. |
@taion did this ever make it into a published I'm on |
This made it in. Check the docs – the API is a bit different. |
@stephenjwatkins |
Hi, I use react-router and history ^3.0.0 and i get this behavior as well but only on the main route.
regards |
This only happens on the initial page load if you go directly a route (/planets in this case) with an
onEnter()
. Subsequent visit to that route via pushState will only trigger it once.I believe this is happening because
match()
and thenrender(<Router> ...)
are both triggering the hook. Perhaps there's a way to avoid this?This can be reproduced with minimal setup:
client/index.js
app/routes.js
The text was updated successfully, but these errors were encountered: