Open
Description
Context
What's your version of nuqs
?
-> https://pkg.pr.new/nuqs@807
What framework are you using?
- ✅ React Router
Which version of your framework are you using?
-> 7.0.2
Description
For some reason, we can't use BrowserRouter in RR7, only HashRouter allowed. But useQueryState always append the whole hash part.
Expect:
http://localhost:5173/#/form
⇓
http://localhost:5173/#/form?keyword=kw
⇓
http://localhost:5173/#/form?keyword=kw1
⇓
http://localhost:5173/#/form?keyword=kw12
⇓
http://localhost:5173/#/form?keyword=kw123
Actual:
http://localhost:5173/#/form
⇓
http://localhost:5173/#/form?keyword=kw#/form
⇓
http://localhost:5173/#/form?keyword=kw1#/form?keyword=kw#/form
⇓
http://localhost:5173/#/form?keyword=kw12#/form?keyword=kw1#/form?keyword=kw#/form
⇓
http://localhost:5173/#/form?keyword=kw123#/form?keyword=kw12#/form?keyword=kw1#/form?keyword=kw#/form
Reproduction
https://github.com/Jungzl/react-router-nuqs-hash-issue
- go to '/form'
- type something, press Enter
- see url