Should search parameter changes trigger route loader reloads when not specified in loaderDeps?
Hi,
I'm using URL search parameters to manage UI state that doesn't affect route loaders or other routing-related functionality. However, I've noticed that whenever a search parameter changes, the entire route tree refreshes and reloads.
I expected the route to reload only when its specified loaderDeps change.
Is this the intended behavior?
Unit tests for reproduction https://github.com/TanStack/router/pull/3160
2 Replies
stormy-goldOP•8mo ago
I guess this discussion may be related https://github.com/TanStack/router/discussions/1712
GitHub
Shallow Routing (prevent reload) · TanStack router · Discussion #17...
Is there an easy way to prevent reloading of the entire route when changing a search param? My use case is keep track of which tab menu the user is on, but updating the URL via Route.navigate trigg...
stormy-goldOP•8mo ago
the defaultStaleTime is 0 which means that the match is stale immediately. this will result in re-running the loader upon navigation, even when non-loader-deps change. if you set stale time to a higher value, you will see that the loader does not re-run when a non-loader-dep is changed