tanstack-integration-best-practices

Integrate TanStack Query, Router, and Start with SSR and caching best practices.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/mjmmattoni98/soundweave --skill tanstack-integration-best-practices-mjmmattoni98
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-integration-best-practices
Source: https://github.com/mjmmattoni98/soundweave/tree/main/.agents/skills/tanstack-integration-best-practices
Command: npx skills add https://github.com/mjmmattoni98/soundweave --skill tanstack-integration-best-practices-mjmmattoni98

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of integrating TanStack Query, Router, and Start, ensuring efficient data flow, seamless SSR, and optimized caching strategies.

Core Features & Use Cases

  • Data Flow Patterns: Implement best practices for fetching, caching, and mutating data across your application.
  • SSR Integration: Configure Server-Side Rendering correctly for TanStack Query and Router.
  • Caching Coordination: Ensure consistent and performant data caching between different TanStack libraries.
  • Use Case: When building a new TanStack Start application, use this Skill to set up TanStack Query with TanStack Router, ensuring data is fetched efficiently and SSR works out-of-the-box.

Quick Start

Follow the setup-query-client-context rule to pass the QueryClient through router context.

Frequently Asked Questions about tanstack-integration-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up TanStack Query with TanStack Router for SSR?

To set up TanStack Query with TanStack Router for SSR, pass the QueryClient through the router context using the setup-query-client-context pattern. This ensures data is fetched efficiently and server-side rendering works out-of-the-box.

What is the best way to coordinate caching between TanStack Query and TanStack Router?

The best way to coordinate caching between TanStack Query and TanStack Router is to implement established data flow patterns. This ensures consistent and performant data caching across your application during fetching and mutating operations.

Why does my TanStack Start application have inconsistent data fetching during Server-Side Rendering?

Inconsistent data fetching during Server-Side Rendering in TanStack Start usually occurs when the QueryClient is not properly passed through the router context. Correct SSR integration rules require specific setup to synchronize data flow.

Can I use TanStack Router for full-stack data flow without TanStack Query?

You can use TanStack Router without TanStack Query, but integrating both provides best practices for full-stack data flow. Combining them ensures optimized caching strategies and seamless SSR coordination across your application.

How do I implement data fetching and mutating patterns in a TanStack Start app?

To implement data fetching and mutating patterns in a TanStack Start app, follow established best practices for full-stack data flow. This approach covers efficient data retrieval, cache coordination, and mutation strategies across the application.