@@ -50,21 +50,16 @@ error states, without assumptions about the shape of your data or the type of re
5050
5151[ abortable fetch ] : https://developers.google.com/web/updates/2017/09/abortable-fetch
5252
53- > ## Upgrading to v4
53+ > ## Upgrading to v6
5454>
55- > When upgrading to React Async v4, please note the following breaking API changes:
56- >
57- > - ` deferFn ` now receives an ` args ` array as the first argument, instead of arguments to ` run ` being spread at the front
58- > of the arguments list. This enables better interop with TypeScript. You can use destructuring to keep using your
59- > existing variables.
60- > - The shorthand version of ` useAsync ` now takes the ` options ` object as optional second argument. This used to be
61- > ` initialValue ` , but was undocumented and inflexible.
55+ > Version 6 comes with a breaking change. See [ Upgrading] ( #upgrading ) for details.
6256
6357# Table of Contents
6458
6559- [ Rationale] ( #rationale )
6660 - [ Concurrent React and Suspense] ( #concurrent-react-and-suspense )
6761- [ Installation] ( #installation )
62+ - [ Upgrading] ( #upgrading )
6863- [ Usage] ( #usage )
6964 - [ As a hook] ( #as-a-hook )
7065 - [ With ` useFetch ` ] ( #with-usefetch )
@@ -124,6 +119,21 @@ yarn add react-async
124119> This package requires ` react ` as a peer dependency. Please make sure to install that as well.
125120> If you want to use the ` useAsync ` hook, you'll need ` react@16.8.0 ` or later.
126121
122+ ### Upgrading
123+
124+ #### Upgrade to v6
125+
126+ - ` <Async.Pending> ` was renamed to ` <Async.Initial> ` .
127+ - Don't forget to deal with any custom instances of ` <Async> ` when upgrading.
128+
129+ #### Upgrade to v4
130+
131+ - ` deferFn ` now receives an ` args ` array as the first argument, instead of arguments to ` run ` being spread at the front
132+ of the arguments list. This enables better interop with TypeScript. You can use destructuring to keep using your
133+ existing variables.
134+ - The shorthand version of ` useAsync ` now takes the ` options ` object as optional second argument. This used to be
135+ ` initialValue ` , but was undocumented and inflexible.
136+
127137## Usage
128138
129139React Async offers three primary APIs: the ` useAsync ` hook, the ` <Async> ` component and the ` createInstance `
0 commit comments