Skip to main content


npm install --save @rest-hooks/react @rest-hooks/test @rest-hooks/hooks @rest-hooks/rest

TypeScript is optional, but requires at least version 3.7 and strictNullChecks for full type enforcement.

Add provider at top-level component

import { CacheProvider } from '@rest-hooks/react';
import ReactDOM from 'react-dom';

<App />

Alternatively integrate state with redux

Older browser support

If your application targets older browsers (a few years or more), be sure to load polyfills. Typically this is done with @babel/preset-env useBuiltIns: 'entry', coupled with importing core-js at the entrypoint of your application.

This ensures only the needed polyfills for your browser support targets are included in your application bundle.

For instance TypeError: Object.hasOwn is not a function

Internet Explorer support

If you see Uncaught TypeError: Class constructor Resource cannot be invoked without 'new', follow the instructions to add legacy browser support to packages


Explore more Rest Hooks demos