Comment on page
The rejection value for failed requests with
useFetchwas changed. Previously it was the Response object. Now it's an Error object with
responseproperty. If you are using
useFetchand are using the
errorvalue, expecting it to be of type Response, you must now use
All standalone helper components were renamed to avoid import naming collision.
<Initial>was renamed to
<Pending>was renamed to
<Fulfilled>was renamed to
<Rejected>was renamed to
<Settled>was renamed to
<Async.Pending>was renamed to
- Some of the other helpers were also renamed, but the old ones remain as alias.
- Don't forget to deal with any custom instances of
deferFnnow receives an
argsarray as the first argument, instead of arguments to
runbeing spread at the front of the arguments list. This enables better interop with TypeScript. You can use destructuring to keep using your existing variables.
- The shorthand version of
useAsyncnow takes the
optionsobject as optional second argument. This used to be
initialValue, but was undocumented and inflexible.