tanstack-query-setup

Configure TanStack Query with QueryClient, provider, and typed hooks.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/vecear/Nipponverb --skill tanstack-query-setup-vecear
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query-setup
Source: https://github.com/vecear/Nipponverb/tree/main/.claude/skills/tanstack-query-setup
Command: npx skills add https://github.com/vecear/Nipponverb --skill tanstack-query-setup-vecear

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing server state in React apps can be complex, with boilerplate for data fetching, mutation handling, caching, and keeping UI in sync. This Skill provides a structured approach to integrate TanStack Query (React Query) for reliable server-state management, including configured QueryClient, provider setup, and reusable hooks.

Core Features & Use Cases

  • Caching and background updates to keep data fresh without refetching on every interaction.
  • Data fetching and mutations via well-typed hooks, with proper invalidation and refetch strategies.
  • Support for infinite queries and pagination to efficiently handle large datasets.

Quick Start

Install dependencies, configure a QueryClient, and wrap your app with the provider to enable server state management.

Frequently Asked Questions about tanstack-query-setup

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

FAQPage Schema
How do I set up server state management with TanStack Query in a React application?

To set up server state management with TanStack Query, install dependencies, configure a QueryClient, wrap your app with the Provider, and create well-structured hooks for queries and mutations with proper cache options.

What is the best way to handle data fetching and mutations in React without excessive refetching?

The best way to handle data fetching and mutations without excessive refetching is using TanStack Query's caching and background updates, which keep data fresh predictably while applying proper invalidation strategies after mutations.

How do I implement optimistic updates and infinite queries for paginated data in React?

Implement optimistic updates and infinite queries by configuring TanStack Query hooks to efficiently handle large datasets, enabling smooth user experiences through predictable caching and offline resilience during pagination.

Does TanStack Query work with Next.js for server state and cache management?

Yes, TanStack Query works with Next.js for server state and cache management, enabling predictable caching, background updates, and smooth user experiences across React-based UIs that fetch and mutate data.

Why do I need a QueryClient and Provider for data fetching in React?

You need a QueryClient and Provider for data fetching in React to establish a centralized server-state management instance, which enables structured cache management, background updates, and integration of optional devtools.