Replies: 1 comment
-
nuqs does this (and adds type-safety, so your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now,
useSearchParams()
returns[searchParams, setSearchParams]
The limit of the set function is that it cannot easily update/add/delete specific search key(s) in a consistent manner.
For instance, in order to update
name
, deleteage
& addlang
in?name=joe&age=7&sex=male&address=xxx
, you'd have to:Propose to add a
updateSearchParams
function to the returned array, so individual param(s) can be easily updated/deleted/added while keeping the rest:The implementation is simple, something like:
Beta Was this translation helpful? Give feedback.
All reactions