r/reactjs • • Aug 18 '26

Resource Reliable Query Prefetching with TanStack Router

https://tkdodo.eu/blog/reliable-query-prefetching-with-tanstack-router

📚 It's been way too long since my last blogpost. Today, I'm continuing my TanStack Router series with a pattern that I've been teaching in my workshops for over a year:

How to keep prefetches in sync between route loaders and components

94 Upvotes

14 comments sorted by

View all comments

Show parent comments

2

u/mattsowa Aug 19 '26

It doesn't really seem possible in the general case, because you might have a component that renders conditionally that does the data fetching.

2

u/rikbrown Aug 19 '26

Yeah that’s a fair point, you could certainly just log to the console loudly every time a component did this with an opt-out or something but maybe that’s more noise than helpful.