UNPKG

@tanstack/react-query

Version:

Hooks for managing, caching and syncing asynchronous and remote data in React

49 lines (39 loc) 3.53 kB
<img src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" /> ![TanStack Query Header](https://github.com/TanStack/query/raw/main/media/repo-header.png) Hooks for fetching, caching and updating asynchronous data in React <a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent"> <img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack"> </a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent"> <img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" /> </a><a href="https://github.com/TanStack/query/actions?query=workflow%3A%22react-query+tests%22"> <img src="https://github.com/TanStack/query/workflows/react-query%20tests/badge.svg" /> </a><a href="https://www.npmjs.com/package/@tanstack/query-core" target="\_parent"> <img alt="" src="https://img.shields.io/npm/dm/@tanstack/query-core.svg" /> </a><a href="https://bundlejs.com/?q=%40tanstack%2Freact-query&config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22react%22%2C%22react-dom%22%5D%7D%7D&badge=" target="\_parent"> <img alt="" src="https://deno.bundlejs.com/?q=@tanstack/react-query&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}}&badge=detailed" /> </a><a href="#badge"> <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"> </a><a href="https://github.com/TanStack/query/discussions"> <img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" /> </a><a href="https://bestofjs.org/projects/tanstack-query"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%2Fquery%26since=daily" /></a><a href="https://github.com/TanStack/query/" target="\_parent"> <img alt="" src="https://img.shields.io/github/stars/TanStack/query.svg?style=social&label=Star" /> </a><a href="https://twitter.com/tannerlinsley" target="\_parent"> <img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" /> </a> <a href="https://gitpod.io/from-referrer/"> <img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/> </a> Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger) ## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more! ## 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](https://reactjs.org/docs/concurrent-mode-suspense.html) + Fetch-As-You-Render Query Prefetching - Dedicated Devtools ### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/) <!-- Use the force, Luke -->