T
TanStack8mo ago
flat-fuchsia

Is there a way to change the default navigation behavior to preserve search params?

Question speaks for itsself haha. But I'd like to not have to write this everywhere....
search={(n) => n}
search={(n) => n}
Just to stop from losing my search param state, not a big deal but was curious
2 Replies
conscious-sapphire
conscious-sapphire8mo ago
retainSearchParams search middleware?
flat-fuchsia
flat-fuchsiaOP8mo ago
yup that will do it, haha I didn't even know I coudl do middleware on mysearch params wtf this library is too good IT's not workign for me for some reason, or do I have to plug this into every route Oh wait got it, just a little derp on my part Works like a charm ❤️

Did you find this page helpful?