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