You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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