// Comprehensive guidance for implementing TanStack libraries (Query, Table, Router, Form, Start, Virtual, Store, DB) in modern web applications. Use when working with data fetching, state management, routing, forms, tables, virtualization, or full-stack React development. Also triggers when working with TanStack-related TypeScript files (.ts, .tsx), files importing from @tanstack packages, or React components using TanStack hooks. Example triggers: "Implement data fetching", "Create a data table", "Set up routing", "Build a form", "Add server-side rendering", "Implement virtual scrolling", "Set up state management", "Use TanStack Query"
| name | rr-tanstack |
| description | Comprehensive guidance for implementing TanStack libraries (Query, Table, Router, Form, Start, Virtual, Store, DB) in modern web applications. Use when working with data fetching, state management, routing, forms, tables, virtualization, or full-stack React development. Also triggers when working with TanStack-related TypeScript files (.ts, .tsx), files importing from @tanstack packages, or React components using TanStack hooks. Example triggers: "Implement data fetching", "Create a data table", "Set up routing", "Build a form", "Add server-side rendering", "Implement virtual scrolling", "Set up state management", "Use TanStack Query" |
TanStack is a suite of framework-agnostic, headless libraries providing type-safe solutions for common web development challenges. All libraries share core principles: framework agnosticism, TypeScript-first design, headless architecture (logic without UI), and performance optimization.
Use this skill when implementing or troubleshooting:
Use for: Data fetching, caching, synchronization, mutations, optimistic updates
Load references/query.md when working with:
Key identifiers: useQuery, useMutation, QueryClient, invalidateQueries, prefetchQuery
Use for: Sortable, filterable, paginated data displays
Load references/table.md when working with:
Key identifiers: Column definitions, sorting, filtering, pagination, row selection
Use for: React applications requiring sophisticated routing with full type safety
Load references/router.md when working with:
Key identifiers: createFileRoute, useNavigate, useParams, useSearch, beforeLoad
Use for: Multi-step forms, validation-intensive forms, dynamic form builders
Load references/form.md when working with:
Key identifiers: FormApi, FieldApi, useForm, array fields, validation rules
Use for: SSR applications with type-safe server functions and progressive enhancement
Load references/start.md when working with:
Key identifiers: createServerFn, createIsomorphicFn, middleware, server routes
Use for: Efficiently rendering thousands of rows/items
Load references/virtual.md when working with:
Key identifiers: useVirtualizer, getVirtualItems, getTotalSize, overscan
Use for: Signals-based state management across frameworks
Load references/store.md when working with:
Key identifiers: Store primitives, useStore, Derived, Effect, Batch
Use for: Local-first applications with real-time sync and optimistic updates
Load references/db.md when working with:
Key identifiers: Collections, live queries, ElectricSQL, LocalStorage, derived collections
references/<library>.md file@tanstack/react-query)Router loaders fetch data using Query for type-safe SSR with caching:
// In route loader
const queryOptions = queryClient.ensureQueryData(userQueryOptions)
Combine for large dataset tables with efficient rendering:
// Virtual handles rendering, Table handles data processing
const virtualizer = useVirtualizer({ count: table.getRowModel().rows.length })
Form submissions trigger mutations with automatic cache invalidation:
// In form submit handler
await createUserMutation.mutateAsync(formData)
Full-stack applications with type-safe routing and data fetching:
// Server functions called from route loaders
const data = await serverFn({ userId })
All libraries support React, Vue, Svelte, Solid, and Angular (with varying levels of maturity). Some libraries also support Lit, Qwik, and vanilla JavaScript. Always use the framework-specific adapter package for optimal integration.
Detailed documentation for each library is available in the references/ directory:
references/query.md — TanStack Query complete referencereferences/table.md — TanStack Table complete referencereferences/router.md — TanStack Router complete referencereferences/form.md — TanStack Form complete referencereferences/start.md — TanStack Start complete referencereferences/virtual.md — TanStack Virtual complete referencereferences/store.md — TanStack Store complete referencereferences/db.md — TanStack DB complete referenceLoad specific reference files as needed based on the implementation task.