Open History to see the last commit
1---
2id: installation
3title: Installation
4---
5β
6You can install React Query via [NPM](https://npmjs.com/),
7or a good ol' `<script>` via
8[ESM.sh](https://esm.sh/).
9β
10### NPM
11β
12```sh
13npm i @tanstack/react-query
14```
15β
16or
17β
18```sh
19pnpm add @tanstack/react-query
20```
21β
22or
23β
24```sh
25yarn add @tanstack/react-query
26```
27β
28or
29β
30```sh
31bun add @tanstack/react-query
32```
33β
34or
35β
36```sh
37deno add @tanstack/react-query
38```
39β
40[//]: # 'Compatibility'
41β
42React Query is compatible with React v18+ and works with ReactDOM and React Native.
43β
44> Wanna give it a spin before you download? Try out the [simple](./examples/simple) or [basic](./examples/basic) examples!
45β
46[//]: # 'Compatibility'
47β
48### CDN
49β
50If 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](https://esm.sh/). Simply add a `<script type="module">` tag to the bottom of your HTML file:
51β
52[//]: # 'CDNExample'
53β
54```html
55<script type="module">
56 import { QueryClient } from 'https://esm.sh/@tanstack/react-query'
57 import ReactDOM from 'https://esm.sh/react-dom@18.2.0'
58 import React from 'https://esm.sh/react@18.2.0'
59</script>
60```
61β
62> You can find instructions on how to use React without JSX [here](https://react.dev/reference/react/createElement#creating-an-element-without-jsx).
63β
64[//]: # 'CDNExample'
65β
66### Requirements
67β
68React Query is optimized for modern browsers. It is compatible with the following browsers config
69β
70```
71Chrome >= 91
72Firefox >= 90
73Edge >= 91
74Safari >= 15
75iOS >= 15
76Opera >= 77
77```
78β
79> 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.
80β
81### Recommendations
82β
83It is recommended to also use our [ESLint Plugin Query](../../eslint/eslint-plugin-query.md) to help you catch bugs and inconsistencies while you code. You can install it via:
84β
85```sh
86npm i -D @tanstack/eslint-plugin-query
87```
88β
89or
90β
91```sh
92pnpm add -D @tanstack/eslint-plugin-query
93```
94β
95or
96β
97```sh
98yarn add -D @tanstack/eslint-plugin-query
99```
100β
101or
102β
103```sh
104bun add -D @tanstack/eslint-plugin-query
105```