tanstack-query

Migrate React apps from TanStack Query v4 to v5 with object-syntax patterns.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/infinite-loop-factory/app-factory --skill tanstack-query-infinite-loop-factory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/infinite-loop-factory/app-factory/tree/main/.agents/skills/tanstack-query
Command: npx skills add https://github.com/infinite-loop-factory/app-factory --skill tanstack-query-infinite-loop-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill consolidates TanStack Query v5 migration guidance, best practices, and practical examples to help React developers modernize their data-fetching layer without confusion.

Core Features & Use Cases

  • Guidance for migrating from v4 to v5, including object-syntax enforcement
  • Reference patterns for queries, mutations, invalidations, and infinite queries
  • Debugging SSR/hydration and networkMode, offlineFirst, and other v5 features
  • Practical examples, tests, and references to ensure safe, consistent adoption

Quick Start

Install or upgrade the latest TanStack packages, run codemods to remove overloads, refactor hooks to object syntax, and consult the references for migration notes.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I migrate React Query from v4 to v5?

Migrate React Query from v4 to v5 by running codemods to remove deprecated overloads and refactoring hooks to object syntax. You get consolidated migration guidance, best practices, and practical examples for safe adoption.

Why does TanStack Query v5 require object syntax for hooks?

TanStack Query v5 requires object syntax to simplify the API by removing overloaded signatures. This skill enforces object-syntax usage and provides reference patterns for queries, mutations, and invalidations to modernize your data-fetching layer.

How do I debug SSR and hydration issues with TanStack Query?

Debug SSR and hydration issues in TanStack Query by consulting reference patterns for networkMode and offlineFirst features. This skill provides debugging guidance to resolve hydration mismatches in React apps using TanStack Query v5.

What's the best way to handle infinite queries in TanStack Query v5?

Handle infinite queries in TanStack Query v5 by using object syntax patterns. This skill provides reference patterns for queries, mutations, and infinite queries, along with practical examples and tests to ensure consistent adoption.

Can I use TanStack Query v5 with offline data fetching?

Use TanStack Query v5 with offline data fetching by configuring networkMode and offlineFirst features. This skill includes debugging references for these v5 features to help manage network connectivity and data synchronization in React apps.