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[unpkg.com](https://unpkg.com).
9β
10### NPM
11β
12```bash
13npm i @tanstack/react-query@4
14```
15β
16or
17β
18```bash
19pnpm add @tanstack/react-query@4
20```
21β
22or
23β
24```bash
25yarn add @tanstack/react-query@4
26```
27β
28React Query is compatible with React v16.8+ and works with ReactDOM and React Native.
29β
30> Wanna give it a spin before you download? Try out the [simple](/query/v4/docs/framework/react/examples/simple) or [basic](/query/v4/docs/framework/react/examples/basic) examples!
31β
32### CDN
33β
34If you're not using a module bundler or package manager we also have a global ("UMD") build hosted on the [unpkg.com](https://unpkg.com) CDN. Simply add the following `<script>` tag to the bottom of your HTML file:
35β
36```html
37<script src="https://unpkg.com/@tanstack/react-query@4/build/umd/index.production.js"></script>
38```
39β
40Once you've added this you will have access to the `window.ReactQuery` object and its exports.
41β
42> This installation/usage requires the [React CDN script bundles](https://reactjs.org/docs/cdn-links.html) to be on the page as well.
43β
44### Requirements
45β
46React Query is optimized for modern browsers. It is compatible with the following browsers config
47β
48```
49Chrome >= 73
50Firefox >= 78
51Edge >= 79
52Safari >= 12.1
53iOS >= 12.2
54Opera >= 53
55```
56β
57> 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.
58β
59### Recommendations
60β
61It 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:
62β
63```bash
64npm i -D @tanstack/eslint-plugin-query@4
65```
66β
67or
68β
69```bash
70pnpm add -D @tanstack/eslint-plugin-query@4
71```
72β
73or
74β
75```bash
76yarn add -D @tanstack/eslint-plugin-query@4
77```