---
title: "TanStack Router and Query"
url: https://daily.dev/posts/tanstack-router-and-query-gqjolqvkh
source_url: https://tkdodo.eu/blog/tan-stack-router-and-query
type: article
source: "TkDodo"
published: 2026-05-26T12:34:23.798Z
updated: 2026-05-26T12:34:49.355Z
tags: ["react"]
reading_time: 9
upvotes: 71
comments: 3
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TanStack Router and Query

**[TkDodo](https://daily.dev/sources/tkdodo)** · 9 min read · 71 upvotes · 3 comments

## Summary

TanStack Router has a built-in per-route cache, but TanStack Query's global QueryCache is better suited for data shared across multiple routes. The post explains why using route loaders to prefetch queries (without awaiting) is a best practice, how to wire up the queryClient in router context, and why components should use useQuery or useSuspenseQuery instead of useLoaderData. It also covers disabling the router's own caching when Query is in charge, the decision between blocking and deferred data loading, and how the integration extends to TanStack Start with SSR streaming that seeds the client-side QueryCache automatically.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tkdodo.eu/blog/tan-stack-router-and-query>

## Community discussion

Top comments from developers on daily.dev.

**@musanna** · 2 upvotes

> I like the Tanstack start approach. But when will it graduate from RC 😅  .

## Similar posts on daily.dev

- [Reliable Query Prefetching with TanStack Router](https://daily.dev/posts/reliable-query-prefetching-with-tanstack-router-vxcwhwfpd) · TkDodo · 20 upvotes · 3 comments
- [Caching with TanStack Query](https://daily.dev/posts/caching-with-tanstack-query-vcjkfwju7) · Telerik · 0 upvotes · 0 comments
- [A gentle introduction to TanStack Query](https://daily.dev/posts/a-gentle-introduction-to-tanstack-query-e5yjmxkk9) · Neciu Dan · 79 upvotes · 5 comments

---

Tags: [#react](https://daily.dev/tags/react)

[View this post on daily.dev](https://daily.dev/posts/tanstack-router-and-query-gqjolqvkh)
