T
TanStack2y ago
rising-crimson

Remove search params with useNavigate hook

Is it possible to remove search params with the useNaviage hook?
2 Replies
fascinating-indigo
fascinating-indigo2y 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-crimson
rising-crimsonOP2y ago
Thanks for this I will give it a bash

Did you find this page helpful?