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.
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 package is upgraded, you can optionally upgrade @rest-hooks/react to 7.
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.
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)