tanstack-query

Provides comprehensive guidance for TanStack Query v5 in React apps.

1|Updated Apr 13, 2015
One-click install
npx skills add https://github.com/tyler-dot-earth/.dotfiles --skill tanstack-query-tyler-dot-earth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/tyler-dot-earth/.dotfiles/tree/main/agents/skills/tanstack-query
Command: npx skills add https://github.com/tyler-dot-earth/.dotfiles --skill tanstack-query-tyler-dot-earth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TanStack Query v5 provides a cohesive approach to managing server state in React applications, consolidating data fetching, caching, and synchronization across components to reduce boilerplate and avoid stale UI.

Core Features & Use Cases

  • Centralized QueryClient configuration and caching strategies
  • UseQuery, useMutation, and useInfiniteQuery patterns
  • v4→v5 migration guidance and object-syntax enforcement
  • Optimistic updates, error handling, and SSR hydration considerations
  • Developer tooling with React Query DevTools
  • Patterns for prefetching, data synchronization, and multi-query composition

Quick Start

Follow the included templates to bootstrap a TanStack Query v5 setup in your React application.

Frequently Asked Questions about tanstack-query

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

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

Migrate React-Query from v4 to v5 by enforcing object-syntax usage for queries and mutations, applying v5 migration rules, and using provided templates to update your React application's server state management configuration.

What is the best way to configure server state caching in React?

Configure server state caching in React by centralizing QueryClient setup, defining caching strategies, and using useQuery patterns to synchronize data fetching and avoid stale UI across application components.

How do I implement optimistic updates with TanStack Query mutations?

Implement optimistic updates with TanStack Query mutations by applying provided best-practice patterns for immediate UI updates, handling errors gracefully, and rolling back changes if the server request fails.

Can I use infinite queries and SSR hydration with React Query v5?

Use infinite queries and SSR hydration with React Query v5 by implementing useInfiniteQuery patterns and server-side rendering hydration considerations to maintain synchronized server state across your React application.

Does TanStack Query v5 work with React Query DevTools?

TanStack Query v5 works with React Query DevTools, providing developer tooling integration to inspect queries, monitor cache states, and debug server state synchronization within your React application.