@@ -50,21 +50,16 @@ error states, without assumptions about the shape of your data or the type of re
50
50
51
51
[ abortable fetch ] : https://developers.google.com/web/updates/2017/09/abortable-fetch
52
52
53
- > ## Upgrading to v4
53
+ > ## Upgrading to v6
54
54
>
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.
62
56
63
57
# Table of Contents
64
58
65
59
- [ Rationale] ( #rationale )
66
60
- [ Concurrent React and Suspense] ( #concurrent-react-and-suspense )
67
61
- [ Installation] ( #installation )
62
+ - [ Upgrading] ( #upgrading )
68
63
- [ Usage] ( #usage )
69
64
- [ As a hook] ( #as-a-hook )
70
65
- [ With ` useFetch ` ] ( #with-usefetch )
@@ -124,6 +119,21 @@ yarn add react-async
124
119
> This package requires ` react ` as a peer dependency. Please make sure to install that as well.
125
120
> If you want to use the ` useAsync ` hook, you'll need ` [email protected] ` or later.
126
121
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
+
127
137
## Usage
128
138
129
139
React Async offers three primary APIs: the ` useAsync ` hook, the ` <Async> ` component and the ` createInstance `
0 commit comments