$ npm i @tanstack/react-query# or$ yarn add @tanstack/react-query
React Query is compatible with React v16.8+ and works with ReactDOM and React Native.
If you're not using a module bundler or package manager we also have a global ("UMD") build hosted on the unpkg.com CDN. Simply add the following
<script> tag to the bottom of your HTML file:
Once you've added this you will have access to the
window.ReactQuery object and its exports.
This installation/usage requires the React CDN script bundles to be on the page as well.
React Query is optimized for modern browsers. It is compatible with the following browsers config
Chrome >= 73Firefox >= 78Edge >= 79Safari >= 12.0iOS >= 12.0opera >= 53
Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from