Hooks for fetching, caching and updating asynchronous data in React
Enjoy this library? Try the entire TanStack! React Table, React Form, React Charts
Visit tanstack.com/query for docs, guides, API and more!
Still on React Query v2? No problem! Check out the v2 docs here: https://react-query-v2.tanstack.com/.
Still on React Query v3? No problem! Check out the v3 docs here: https://react-query-v3.tanstack.com/.
Quick Features
- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)
- Parallel + Dependent Queries
- Mutations + Reactive Query Refetching
- Multi-layer Cache + Automatic Garbage Collection
- Paginated + Cursor-based Queries
- Load-More + Infinite Scroll Queries w/ Scroll Recovery
- Request Cancellation
- React Suspense + Fetch-As-You-Render Query Prefetching
- Dedicated Devtools
- (depending on features imported)
Become a Sponsor!
Contributors β¨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!