getInitialProps is not running when Router.replace's "href" and "as" contains hash and query params inside "href" change. #10900
Labels
good first issue
Easy to fix issues, good for newcomers
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Milestone
Bug report
getInitialProps is not running when "href" and "as" contains hash and query params inside "href" change when calling Router.replace or Router.push
Bug description.
When pushing or replacing url and query params inside "href" (but not in "as") change, getInitialProps method is re-called. However, if both "href" and "as" include hash, the getInitialProps method is not re-called.
To Reproduce
Here is the minimum amount of code to reproduce:
Expected behavior
I am expecting getInitialProps to be re-called when query params change in "href" when calling Router.replace or Router.push and hash also exists in the url - that is because I do not want to show certain query params to the user in browser url, but I definitely want to keep the hash visible.
System information
Additional context
I am trying to hide some query params in browser url and not show to the user + I want the hash to be visible in browser url.
The text was updated successfully, but these errors were encountered: