-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Description
What version of Next.js are you using?
10.0.9
What version of Node.js are you using?
14.16.0
What browser are you using?
Chromium Edge
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
For a language switcher, I only change the locale for the page and nothing in the url. Using router.push
with the Url object representing the current page and setting hash
to the hash of the current page, there is only a hashChangeStart
and subsequent hashChangeComplete
event and not a props update.
Expected Behavior
There should be a page update (for fetching new translations etc.) while keeping the hash in the url.
To Reproduce
https://codesandbox.io/s/heuristic-blackburn-jpu7g
In the demo, go the "About Page" or the "Post Page". Click on the "Change Language" button. The value of the locale in useRouter
updates while the props do not. There are also the hashChange
events in the console.
Setting router.push
to not set the hash
(in components/demo
) causes a props update as expected but removes the hash.