Option to not persist hash
Thanks for creating and maintaining this library!
Is your feature request related to a problem? Please describe.
When the hash relates to an element id on the page (often the intended purpose of using a hash), the viewport jumps to that element whenever the search params change.
The search params are controlled via a toolbar at the top of the page. If a user has previously visited a hash location within the document, I don't want to refocus it whenever a user interacts with the toolbar.
Describe the solution you'd like
An option to not persist the hash when search params change.
Personally I would expect this by default but understand others expect the opposite, and a change to default behaviour would be a breaking change, so a configurable opt-in would probably be best.
This is probably only an issue when you're using hashes that are ids of elements within the page.
Additional context
Related
- Reasoning for not persisting hash in React Router
- https://github.com/pbeshai/use-query-params/issues/229