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

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

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



TanStack

Query v4v4

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

v4

Search...

+ K

Menu

Getting Started

Guides & Concepts

Community Resources

API Reference

ESLint

Plugins

Examples

Framework

React logo

React

Version

v4

Menu

Getting Started

Guides & Concepts

Community Resources

API Reference

ESLint

Plugins

Examples

On this page

Installation

Copy Markdown

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

### NPM

bash

npm i @tanstack/react-query@4


npm i @tanstack/react-query@4

or

bash

pnpm add @tanstack/react-query@4


pnpm add @tanstack/react-query@4

or

bash

yarn add @tanstack/react-query@4


yarn add @tanstack/react-query@4

React Query is compatible with React v16.8+ 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 we also have a global ("UMD") build hosted on the unpkg.com CDN. Simply add the following <script> tag to the bottom of your HTML file:

html

<script src="https://unpkg.com/@tanstack/react-query@4/build/umd/index.production.js"></script>


<script src="https://unpkg.com/@tanstack/react-query@4/build/umd/index.production.js"></script>

Once you've added this you will have access to the window.ReactQuery object and its exports.

This installation/usage requires the React CDN script bundles to be on the page as well.

### Requirements

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

Chrome >= 73
Firefox >= 78
Edge >= 79
Safari >= 12.1
iOS >= 12.2
Opera >= 53


Chrome >= 73
Firefox >= 78
Edge >= 79
Safari >= 12.1
iOS >= 12.2
Opera >= 53

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@4


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

or

bash

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


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

or

bash

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


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

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)

You are currently reading v4 docs. Redirect to latest version?

Latest Hide

scarf analytics