What problem does it solve?
TanStack Query solves the problem of manually managing server-state fetching, caching, and synchronization in web apps so your UI stays responsive and up to date.
Core Features & Use Cases
- Server-state fetching & caching: Automatically caches query results and keeps data fresh with stale-while-revalidate patterns.
- Automatic refetching & invalidation: Refetches on mount, focus, reconnect, or explicit invalidation to keep views consistent.
- Mutations with optimistic updates: Updates the UI immediately and rolls back safely when server requests fail.
- Pagination & infinite scrolling: Supports paged data and cursor-based infinite lists for feed-like experiences.
- SSR, hydration, and prefetching: Enables server-side prefetch and client hydration to reduce loading time and flicker.
Quick Start
Use the tanstack-query skill to configure React Query v5 in your app, then write query keys and query functions that fetch your server data with caching and automatic refetch behavior.