Remove search params with useNavigate hook
Is it possible to remove search params with the useNaviage hook?
2 Replies
fascinating-indigo•2y ago
I’m wondering this too. Here I’m removing a param like so when an input field in empty
‘’’ts
const debouncedNavigate = debounce(
(value) => {
navigate({
params: (...prev) => ({ ...prev }),
search: (prev) => ({ ...prev, search: value }),
})
value === '' &&
navigate({
params: (...prev) => ({ ...prev }),
search: (prev) => ({ ...prev, search: undefined }),
})
},
{ waitMs: 500 },
)
‘’’
Realize maybe I have a typo in param arg hmm
rising-crimsonOP•2y ago
Thanks for this I will give it a bash