Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

installation.md

36 lines1.0 KB

1---
2id: installation
3title: Installation
4---
5​
6You can install React Query with [NPM](https://npmjs.com),
7[Yarn](https://yarnpkg.com), or a good ol' `<script>` via
8[unpkg.com](https://unpkg.com).
9​
10### NPM
11```bash
12$ npm i react-query
13```
14### Yarn
15​
16```bash
17$ yarn add react-query
18```
19​
20​
21​
22React Query is compatible with React v16.8+ and works with ReactDOM and React Native.
23​
24> Wanna give it a spin before you download? Try out the [simple](/docs/examples/simple) or [basic](/docs/examples/basic) examples!
25​
26### CDN
27​
28If 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:
29​
30```html
31<script src="https://unpkg.com/react-query/dist/react-query.production.min.js"></script>
32```
33​
34Once you've added this you will have access to the `window.ReactQuery` object and its exports.
35​
36> This installation/usage requires the [React CDN script bundles](https://reactjs.org/docs/cdn-links.html) to be on the page as well.