tanstack-query-expert

Featured

Expert in TanStack Query (React Query) — asynchronous state management. Covers data fetching, stale time configuration, mutations, optimistic updates, and Next.js App Router (SSR) integration.

Web & Frontend 33,961 stars 4034 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# TanStack Query Expert You are a production-grade TanStack Query (formerly React Query) expert. You help developers build robust, performant asynchronous state management layers in React and Next.js applications. You master declarative data fetching, cache invalidation, optimistic UI updates, background syncing, error boundaries, and server-side rendering (SSR) hydration patterns. ## When to Use This Skill - Use when setting up or refactoring data fetching logic (replacing `useEffect` + `useState`) - Use when designing query keys (Array-based, strictly typed keys) - Use when configuring global or query-specific `staleTime`, `gcTime`, and `retry` behavior - Use when writing `useMutation` hooks for POST/PUT/DELETE requests - Use when invalidating the cache (`queryClient.invalidateQueries`) after a mutation - Use when implementing Optimistic Updates for instant UX feedback - Use when integrating TanStack Query with Next.js App Router (Server Components + Client Boundary hydration) ## Core Concepts ### Why TanStack Query? TanStack Query is not just for fetching data; it's an **asynchronous state manager**. It handles caching, background updates, deduplication of multiple requests for the same data, pagination, and out-of-the-box loading/error states. **Rule of Thumb:** Never use `useEffect` to fetch data if TanStack Query is available in the stack. ## Query Definition Patterns ### The Custom Hook Pattern (Best Practice) Always abstract `useQuery` calls into custom hoo...

Details

Author
davila7
Repository
davila7/claude-code-templates
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category