location hash change doesnt trigger hashchange event #69256
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/bitter-framework-zmcyr4?file=%2Fapp%2Fpage.tsx%3A1%2C1-37%2C21
To Reproduce
im trying to create a hash based routing in next 14 but the window hashchange event does'nt trigger when i change the location hash in these ways:
Link to #some-hash Link to #some-hash Link to #some-hash Link to #some-hashi have even tried to push using the router like this:
router.push("#some-hash");
but non of them triggers the hashchange event.
the only way that i get succeed was using the window itself to change the hash like this:
window.location.hash = "some hash"
but i wanna use next js router to implement this. any thoughts?
Current vs. Expected behavior
i expected at least an event listener to be triggered or sth else that would help us to create hash based minimal routing systems
Provide environment information
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: