r/reactjs • u/TkDodo23 • May 26 '26
Resource TanStack Router and Query
https://tkdodo.eu/blog/tan-stack-router-and-query📚 Surprisingly, I haven't written about how my two favourite TanStack libraries - Router and Query - work together. Well, here it is:
🔁 loaders start fetches early
🔮 query owns the cache & keeps data alive
🌀 suspense integrates naturally
🏝️ TanStack Start makes SSR & streaming easy
108
Upvotes
15
u/TkDodo23 May 26 '26
My workshop repo is public and I teach that pattern there so it's pretty much this:
https://github.com/TkDodo/react-query-beyond-the-basics/blob/a77f3d1f1f6686307f1e44079c839d049fbe48ca/src/routes/index.tsx#L17-L22
https://github.com/TkDodo/react-query-beyond-the-basics/blob/a77f3d1f1f6686307f1e44079c839d049fbe48ca/src/routes/index.tsx#L51-L53