Replies: 4 comments 5 replies
-
I wonder if this is a bug instead of a feature |
Beta Was this translation helpful? Give feedback.
-
It appears that the pendingComponent will display when navigating to the same page and updating just the parameters only when the loaderDeps is used. I'm not sure why that is. It seems that the loader code is still called whenever the loaderDeps option isn't run. Here's a demo: https://stackblitz.com/edit/github-nnbjygkg-wci72ac4?file=src%2Fmain.tsx |
Beta Was this translation helpful? Give feedback.
-
Have you tried setting I think - obv confirm :) |
Beta Was this translation helpful? Give feedback.
-
Honestly I think you might want to “graduate” to react-query. Use the loader to prefetch whatever queries your route uses As search params change, update the queries. You could even still use the pendingComponent if you use useSuspenseQuery, and to avoid existing content from suspending when search params change you could use useDeferredValue (iirc, I’m afk) to feed your query params. Examples here https://frontendmasters.com/blog/tanstack-router-data-loading-2/ |
Beta Was this translation helpful? Give feedback.
-
Let's say I have a route, with a loader that depends on a search param called search.
This search param is updated based on user input for searching data inside the router. After first load I don't want to show pending component again, as it would rerender everything. I want to be able to keep the user at the same place and not call the loader again but now only the search params.
Is that possible?
Beta Was this translation helpful? Give feedback.
All reactions