tanstack-query

Manage server-state with automatic caching and background updates for TS/JS front-ends.

117|11|Updated Aug 19, 2025
One-click install
npx skills add https://github.com/bskimball/tanstack-hono --skill tanstack-query-bskimball
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query
Source: https://github.com/bskimball/tanstack-hono/tree/main/.agents/skills/tanstack-query
Command: npx skills add https://github.com/bskimball/tanstack-hono --skill tanstack-query-bskimball

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TanStack Query addresses the complexity of managing server state in client apps by providing automatic caching, background updates, and data synchronization across components.

Core Features & Use Cases

  • Query and Mutation APIs that simplify data fetching, caching, and update strategies.
  • SSR hydration, prefetching, and parallel queries for fast, SEO-friendly apps.
  • Development ergonomics with typed configuration, query keys hierarchies, and utilities for prefetching and invalidation.

Quick Start

Create a minimal TanStack Query setup with a QueryClient and a useQuery example.

Frequently Asked Questions about tanstack-query

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

FAQPage Schema
How do I manage server state and caching in a React application?

Server state management in React applications is handled by configuring a QueryClient to provide automatic caching, background updates, and data synchronization across UI components using TanStack Query.

How do I implement data fetching and prefetching for SSR hydration in TypeScript?

Data fetching and SSR hydration in TypeScript apps are implemented by using query and mutation APIs alongside prefetching utilities to achieve fast, SEO-friendly rendering with typed configuration helpers.

Does TanStack Query work with Vue, Solid, Svelte, and Angular for data synchronization?

TanStack Query supports data synchronization and cache management across Vue, Solid, Svelte, and Angular front-ends, applying typed query and mutation APIs for consistent client and SSR contexts.

What is the best way to handle cache invalidation and optimistic updates in JavaScript apps?

Cache invalidation and optimistic updates in JavaScript apps are best handled using query key hierarchies and mutation APIs to automatically synchronize UI components and refresh stale background data.

How do I set up a minimal TanStack Query configuration with useQuery?

A minimal TanStack Query configuration requires initializing a QueryClient and then calling the useQuery hook to fetch, cache, and synchronize data across your application's UI components.

When should I not use a dedicated server-state library for data fetching?

You should reconsider a dedicated server-state library if your application relies on purely static local data without needing background updates, cache invalidation, or complex data synchronization across components.