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```bash
13npm i @tanstack/react-query
14```
15β
16or
17β
18```bash
19pnpm add @tanstack/react-query
20```
21β
22or
23β
24```bash
25yarn add @tanstack/react-query
26```
27β
28or
29β
30```bash
31bun add @tanstack/react-query
32```
33β
34React Query is compatible with React v18+ and works with ReactDOM and React Native.
35β
36> Wanna give it a spin before you download? Try out the [simple](../examples/simple) or [basic](../examples/basic) examples!
37β
38### CDN
39β
40If 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:
41β
42```html
43<script type="module">
44 import React from 'https://esm.sh/react@18.2.0'
45 import ReactDOM from 'https://esm.sh/react-dom@18.2.0'
46 import { QueryClient } from 'https://esm.sh/@tanstack/react-query'
47</script>
48```
49β
50> You can find instructions on how to use React without JSX [here](https://react.dev/reference/react/createElement#creating-an-element-without-jsx).
51β
52### Requirements
53β
54React Query is optimized for modern browsers. It is compatible with the following browsers config
55β
56```
57Chrome >= 91
58Firefox >= 90
59Edge >= 91
60Safari >= 15
61iOS >= 15
62Opera >= 77
63```
64β
65> 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.
66β
67### Recommendations
68β
69It 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:
70β
71```bash
72npm i -D @tanstack/eslint-plugin-query
73```
74β
75or
76β
77```bash
78pnpm add -D @tanstack/eslint-plugin-query
79```
80β
81or
82β
83```bash
84yarn add -D @tanstack/eslint-plugin-query
85```
86β
87or
88β
89```bash
90bun add -D @tanstack/eslint-plugin-query
91```