-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Changing hash in URL causes getInitialProps to be re-fired #2825
Comments
@arunoda it seems like you might have experience with this (based on the PR you opened) -- any thoughts on this issue? |
So the issue here is that the hash change only checks |
@ldthorne I'm looking into this today. |
Hi @arunoda, any chance you've had any luck tracking down the issue? |
If you don't want to use route in anyway, I think has more sense to just use |
Thanks for the suggestion, @coluccini. I tried that in my example repo, but it still fires |
Ups, I didn't read that this was happening when clicking back button. Sorry. |
No worries. Thanks for your help! |
Hi @arunoda, any chance you have any updates? |
I'm looking into this now and I think I have a fix. It appears to be that I think I might take a look at a bunch of hash-navigation related bugs and see if I can make PRs for a them while I'm digging around in here... |
…ps' of github.com:mherodev/next.js into bugfix/vercel#2825-changing-hash-triggers-getInitialProps
Changing the hash in the URL causes getInitialProps to be fired, which I think should've been fixed in this PR. See the following example repo: https://github.com/ldthorne/nextjs-back-reproduction.
Expected Behavior
If the user clicks the
go somewhere
link that leads to an anchor -- which will add a hash to the url -- and then clicks the back button,getInitialProps
should not be called.Current Behavior
If the user clicks the
go somewhere
link that leads to an anchor -- which will add a hash to the url -- and then clicks the back button,getInitialProps
is called.Steps to Reproduce (for bugs)
yarn
.go somewhere
link. Notice that nothing is logged.getInitialProps
is logged.Your Environment
The text was updated successfully, but these errors were encountered: