Skip to content

TanStackQuery

Source URL: https://tanstack.com/query/latest

TanStack

Query v5v5

AlphaTry TanStack CLI

Search…

K

Auto

Log In

StartRC

StartRC

Router

Router

Query

Query

Table

Table

DBbeta

DBbeta

AIalpha

AIalpha

Formnew

Formnew

Virtual

Virtual

Pacerbeta

Pacerbeta

Hotkeysalpha

Hotkeysalpha

Storealpha

Storealpha

Devtoolsalpha

Devtoolsalpha

CLIalpha

CLIalpha

More Libraries

More Libraries

BuilderAlpha

BuilderAlpha

FeedBeta

FeedBeta

Maintainers

Maintainers

Partners

Partners

Showcase

Showcase

Blog

Blog

LearnNEW

LearnNEW

Support

Support

Stats

Stats

Discord

Discord

Merch

Merch

GitHub

GitHub

Ethos

Ethos

Tenets

Tenets

Brand Guide

Brand Guide

Docs

Partners

CodeRabbitCodeRabbitCloudflareCloudflareAG GridAG GridSerpAPISerpAPINetlifyNetlifyNeonNeonWorkOSWorkOSClerkClerkConvexConvexElectricElectricPowerSyncPowerSyncSentrySentryRailwayRailwayPrismaPrismaStrapiStrapiUnkeyUnkeyCodeRabbitCodeRabbitCloudflareCloudflareAG GridAG GridSerpAPISerpAPINetlifyNetlifyNeonNeonWorkOSWorkOSClerkClerkConvexConvexElectricElectricPowerSyncPowerSyncSentrySentryRailwayRailwayPrismaPrismaStrapiStrapiUnkeyUnkey

ReactReact

Latest

Search…

K

latest

ReactReact

Latest

Powerful asynchronous state management, server-state utilities and data fetching

Section titled “Powerful asynchronous state management, server-state utilities and data fetching”

Powerful asynchronous state management, server-state utilities and data fetching. Fetch, cache, update, and wrangle all forms of async data in your TS/JS, React, Vue, Solid, Svelte & Angular applications all without touching any “global state”

Read the Docs

1,051

Contributors on GitHub

743,729

Dependents on GitHub

Just a quick look…

ReactPreactVueAngularSolidSvelte

import { useQuery } from '@tanstack/react-query'
function Todos() {
const { data, isPending, error } = useQuery({
queryKey: ['todos'],
queryFn: () => fetch('/api/todos').then(r => r.json()),
})
if (isPending) return <span>Loading...</span>
if (error) return <span>Oops!</span>
return <ul>{data.map(t => <li key={t.id}>{t.title}</li>)}</ul>
}
export default Todos

Writing your data fetching logic by hand is over. Tell TanStack Query where to get your data and how fresh you need it to be and the rest is automatic. It handles caching, background updates and stale data out of the box with zero-configuration.

If you know how to work with promises or async/await, then you already know how to use TanStack Query. There’s no global state to manage, reducers, normalization systems or heavy configurations to understand. Simply pass a function that resolves your data (or throws an error) and the rest is history.

TanStack Query is configurable down to each observer instance of a query with knobs and options to fit every use-case. It comes wired up with dedicated devtools, infinite-loading APIs, and first class mutation tools that make updating your data a breeze. Don’t worry though, everything is pre-configured for success!

See what teams are saying

“Honestly, if React Query had been around before Redux, I don’t think Redux would have been nearly as popular as it was.”

Kent C. Dodds

@kentcdodds · Epic Web

“If I could go back in time and mass myself… I would hand myself a flash drive with a copy of react-query on it.”

Kent C. Dodds

@kentcdodds · Epic Web

“React Query won. There’s no denying that.”

Theo Browne

@t3dotgg · Ping Labs

“TanStack Query has been a game-changer for us. We love using it for react-admin.”

react-admin

@ReactAdmin · Marmelab

“The more I use React + Vite + TanStack Router + TypeScript + TanStack Query, the more I love it.”

Catalin Pit

@catalinmpit · Developer Advocate

“Combined with React Query, this stack has been a game-changer for my productivity.”

Dominik (TkDodo)

@TkDodo · TanStack

“Honestly, if React Query had been around before Redux, I don’t think Redux would have been nearly as popular as it was.”

Kent C. Dodds

@kentcdodds · Epic Web

“If I could go back in time and mass myself… I would hand myself a flash drive with a copy of react-query on it.”

Kent C. Dodds

@kentcdodds · Epic Web

“React Query won. There’s no denying that.”

Theo Browne

@t3dotgg · Ping Labs

“TanStack Query has been a game-changer for us. We love using it for react-admin.”

react-admin

@ReactAdmin · Marmelab

“The more I use React + Vite + TanStack Router + TypeScript + TanStack Query, the more I love it.”

Catalin Pit

@catalinmpit · Developer Advocate

“Combined with React Query, this stack has been a game-changer for my productivity.”

Dominik (TkDodo)

@TkDodo · TanStack

With zero dependencies, TanStack Query is extremely lean given the dense feature set it provides. From weekend hobbies all the way to enterprise e-commerce systems (Yes, I’m lookin’ at you Walmart!), TanStack Query is the battle-hardened tool to help you succeed at the speed of your creativity.

Backend agnostic Dedicated Devtools Auto Caching Auto Refetching Window Focus Refetching Polling/Realtime Queries Parallel Queries Dependent Queries Mutations API Automatic Garbage Collection Paginated/Cursor Queries Load-More/Infinite Scroll Queries Scroll Recovery Request Cancellation Suspense Ready! Render-as-you-fetch Prefetching Variable-length Parallel Queries Offline Support SSR Support Data Selectors

Instead of writing reducers, caching logic, timers, retry logic, complex async/await scripting (I could keep going…), you literally write a tiny fraction of the code you normally would. You will be surprised at how little code you’re writing or how much code you’re deleting when you use TanStack Query. Try it out with one of the examples below!

ReactPreactVueAngularSolidSvelte

Tanner LinsleyDominik DorfmeisterLachlan CollinsVedanta SomnatheFredrik HöglundJonghyeon KoArnoud de VriesAryan DeoraDamian OsipiukEliya Cohen

View All Maintainers

CodeRabbitCodeRabbitCloudflareCloudflareAG GridAG GridSerpAPISerpAPINetlifyNetlifyWorkOSWorkOSNeonNeonClerkClerkConvexConvexElectricElectricSentrySentryRailwayRailwayPowerSyncPowerSyncPrismaPrismaStrapiStrapiUnkeyUnkeyFireshipNozzle.io

Query You?

We’re looking for TanStack Query Partners to join our mission! Partner with us to push the boundaries of TanStack Query and build amazing things together.

[Let’s chat](mailto:partners@tanstack.com?subject=TanStack TanStack Query Partnership)

View Previous Partners

See how developers are using this library

View all projects

Become a Sponsor

Wow, you’ve come a long way!

Only one thing left to do…

Read the Docs!

Blog

@Tan_Stack on X.com

@TannerLinsley on X.com

GitHub

Youtube

Nozzle.io - Keyword Rank Tracker

Ethos

Tenets

Privacy Policy

Terms of Service

© 2026 TanStack LLC