TanStack Query: Async state management and data fetching
Declarative server-state caching with automatic background synchronization.
Learn more about TanStack Query
TanStack Query is a JavaScript library for managing asynchronous server state in web applications through automated caching and synchronization mechanisms. It wraps data-fetching logic with intelligent background refetching, automatic cache invalidation, and optimistic updates to keep client-side state synchronized with server data sources. The library implements a query key system that maps data requests to cached entries, enabling automatic deduplication of concurrent requests and efficient cache management across component boundaries. It integrates with popular frontend frameworks like React, Vue, and Solid by providing hooks or primitives that connect component lifecycles to query states. The architecture prioritizes developer experience by handling loading states, error handling, and cache staleness policies declaratively without requiring manual coordination of network requests.

Protocol-agnostic fetching
Works with REST, GraphQL, or any promise-based data source without requiring framework-specific adapters. The same query logic can be reused across different API patterns.
Multi-framework support
Provides framework-specific implementations for React, Vue, Svelte, and Solid through separate packages that share a common query-core engine, allowing consistent patterns across different frontend stacks.
Built-in cache strategies
Implements automatic cache management with configurable stale-while-revalidate behavior, request deduplication, and background refetching without requiring manual cache invalidation logic in most cases.
import { useQuery } from '@tanstack/react-query';
function UserProfile({ userId }) {
const { data, isLoading, error } = useQuery({
queryKey: ['user', userId],
queryFn: () => fetch(`/api/users/${userId}`).then(res => res.json())
});
if (isLoading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return <div>{data.name}</div>;
}Updates query-core dependency to version 5.90.20
- –Updated dependencies: @tanstack/query-core@5.90.20
Updates persist client core and svelte query dependencies
- –Updated dependencies: @tanstack/query-persist-client-core@5.91.19
- –@tanstack/svelte-query@6.0.18
Updates persist client core and solid query dependencies
- –Updated dependencies: @tanstack/query-persist-client-core@5.91.19
- –@tanstack/solid-query@5.90.23
See how people are using TanStack Query
Top in Frontend
Related Repositories
Discover similar tools and frameworks used by developers
Bootstrap
Sass-based component library with responsive grid system.
Angular Components
Material Design components and utilities for Angular applications.
tradingview
Custom datafeed integration for Tradingview charting library.
Responsive HTML Email Template
Cross-client HTML email starter with inline CSS support.
Tailwind CSS Typography
Cascading typographic styles for unstyled HTML containers.