T
TanStack2y ago
secure-lavender

Global search param

Starting from the auth layout there is a search param (gameServerId) that needs to be set for every route within that layout . However when navigating I currently need to set that search param again for every navigation... Is there a way to maintain that global search param? I thought I could achieve this through the validateSearch from the _auth, but that does not allow me to set custom search
5 Replies
like-gold
like-gold2y ago
Whenever you navigate you would have to use a callback -> navigate({ search: prev => ({ ...prev }); to retain the current search params
secure-lavender
secure-lavenderOP2y ago
thx
robust-apricot
robust-apricot2y ago
This will also work navigate({ search: true});
secure-lavender
secure-lavenderOP2y ago
that's not too bad, is there something similar for Link as well?
absent-sapphire
absent-sapphire2y ago
navigate and Link share the same API

Did you find this page helpful?