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.
Related Reading
Guides and comparisons from the Greptile content library
Best AI Code Review Tools for GitHub
Top-rated AI code review tools for GitHub teams in 2025. Compare features, pricing, and accuracy to find the perfect fit for faster PR reviews and bulletproof code quality.
Top AI Code Review Tools for Small Dev Teams 2026
Affordable, lightweight AI code review tools that help small teams catch bugs faster. Practical comparisons of accuracy, ease of use, and value for teams without enterprise budgets.
Greptile Ranks #1 on Martian's AI Code Review Benchmark
Greptile ranks #1 on Martian's independent online AI code review benchmark, leading all evaluated tools in F1 score and precision with near-leading recall.
Best Security-Focused AI Code Review Tools [2026 Guide]
The six best security-focused AI code review tools, compared on SAST, SCA, DAST, and full-repo context, so you can pick the one that fits your codebase and your cycle times.