📄 tanstack/query/latest/docs/framework/react/installation

File: installation.md | Updated: 11/15/2025

Source: https://tanstack.com/query/latest/docs/framework/react/installation



TanStack

Query v5v5

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Guides & Concepts

API Reference

ESLint

Examples

Plugins

Framework

React logo

React

Version

Latest

Menu

Getting Started

Guides & Concepts

API Reference

ESLint

Examples

Plugins

On this page

Installation

Copy Markdown

You can install React Query via NPM , or a good ol' <script> via ESM.sh .

### NPM

bash

npm i @tanstack/react-query


npm i @tanstack/react-query

or

bash

pnpm add @tanstack/react-query


pnpm add @tanstack/react-query

or

bash

yarn add @tanstack/react-query


yarn add @tanstack/react-query

or

bash

bun add @tanstack/react-query


bun add @tanstack/react-query

React Query is compatible with React v18+ and works with ReactDOM and React Native.

Wanna give it a spin before you download? Try out the simple or basic examples!

### CDN

If you're not using a module bundler or package manager, you can also use this library via an ESM-compatible CDN such as ESM.sh . Simply add a <script type="module"> tag to the bottom of your HTML file:

html

<script type="module">
  import React from 'https://esm.sh/react@18.2.0'
  import ReactDOM from 'https://esm.sh/react-dom@18.2.0'
  import { QueryClient } from 'https://esm.sh/@tanstack/react-query'
</script>


<script type="module">
  import React from 'https://esm.sh/react@18.2.0'
  import ReactDOM from 'https://esm.sh/react-dom@18.2.0'
  import { QueryClient } from 'https://esm.sh/@tanstack/react-query'
</script>

You can find instructions on how to use React without JSX here .

### Requirements

React Query is optimized for modern browsers. It is compatible with the following browsers config

Chrome >= 91
Firefox >= 90
Edge >= 91
Safari >= 15
iOS >= 15
Opera >= 77


Chrome >= 91
Firefox >= 90
Edge >= 91
Safari >= 15
iOS >= 15
Opera >= 77

Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from node_modules yourselves.

### Recommendations

It is recommended to also use our ESLint Plugin Query to help you catch bugs and inconsistencies while you code. You can install it via:

bash

npm i -D @tanstack/eslint-plugin-query


npm i -D @tanstack/eslint-plugin-query

or

bash

pnpm add -D @tanstack/eslint-plugin-query


pnpm add -D @tanstack/eslint-plugin-query

or

bash

yarn add -D @tanstack/eslint-plugin-query


yarn add -D @tanstack/eslint-plugin-query

or

bash

bun add -D @tanstack/eslint-plugin-query


bun add -D @tanstack/eslint-plugin-query

Edit on GitHub

Overview

Quick Start

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

[###### Want to Skip the Docs?

Query.gg - The Official React Query Course
\

“If you’re serious about *really* understanding React Query, there’s no better way than with query.gg”—Tanner Linsley

Learn More](https://query.gg/?s=tanstack)

scarf analytics