Rest Hooks 7
For most people, upgrading to Rest Hooks 7 is as easy as upgrading the packages as long as you aren’t using previously (2 years ago) deprecated exports.
- NPM
- Yarn
yarn add rest-hooks@7 @rest-hooks/react@6 @rest-hooks/redux@6 @rest-hooks/test@9 @rest-hooks/img@0.7
npm install --save rest-hooks@7 @rest-hooks/react@6 @rest-hooks/redux@6 @rest-hooks/test@9 @rest-hooks/img@0.7
The big difference here is all react-specific code has been moved into @rest-hooks/react, which is now a peer dependency of the other packages. The rest-hooks package re-exports everything from @rest-hooks/react.
@rest-hooks/react@7
Once the rest-hooks
package is upgraded, you can optionally upgrade @rest-hooks/react to 7.
- NPM
- Yarn
yarn add @rest-hooks/react@7
npm install --save @rest-hooks/react@7
React Native
Because the React Native and Web interfaces are the same, we ship them in the same package and delivery appropriate specializations where appropriate.
The only breaking change is that useSuspense, useSubscription, useLive, useFetch are all react-native aware. This is unlikely to cause any issue, as screen focus will trigger fetches on stale data.
@rest-hooks/react@7.1
New additions in 7.1
- LogoutManager listens for 401 to trigger logout
- useLive() combines useSuspense() with useSubscription()
- <AsyncBoundary/> combines Suspense with NetworkErrorBoundary
- Middleware API gets full controller
- Block dispatches after unmount (#2307)
@rest-hooks/ssr@0.7
Newly added guide and utilities specific for making NextJS integration easier.