You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/interfaces.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ React Async provides several ways to use it. The classic interface is through th
4
4
backwards compatible to React v16.3. More recent React applications will be using hooks, of which two are provided:
5
5
`useAsync` and `useFetch`. Functionally, `<Async>` and `useAsync` are equivalent. `useFetch` is a special type of `useAsync` which is tied to the native `fetch` API.
6
6
7
-
React Async accepts a wide range of [configuration options](options.md) and returns a set of [render props](props.md).
7
+
React Async accepts a wide range of [configuration options](options.md) and returns a set of [state props](state.md).
8
8
The way you use these differs slightly between the `useAsync` and `useFetch` hooks, and the `<Async>` component.
9
9
10
10
## `Async` component
11
11
12
12
```jsx
13
-
<Async {...options}>{props=>...}</Async>
13
+
<Async {...options}>{state=>...}</Async>
14
14
```
15
15
16
16
-[`options`](options.md) Configuration options
17
-
-[`props`](props.md)Render props object
17
+
-[`state`](state.md)State object
18
18
19
19
> We recommend that you pass the options individually, rather than using JSX [spread attributes]. React Async uses
20
20
> [render props] to return its state back to you, so it can be used by other components further down the tree.
@@ -25,24 +25,24 @@ The way you use these differs slightly between the `useAsync` and `useFetch` hoo
25
25
## `useAsync` hook
26
26
27
27
```js
28
-
constprops=useAsync(options)
28
+
conststate=useAsync(options)
29
29
```
30
30
31
-
-[`props`](props.md)Render props object
31
+
-[`state`](state.md)State object
32
32
-[`options`](options.md) Configuration options
33
33
34
-
> We recommend that you pass `options` as an inline object literal, and that you [destructure] the `props` object to
34
+
> We recommend that you pass `options` as an inline object literal, and that you [destructure] the `state` object to
35
35
> extract the properties you need, unless you have multiple instances in the same component.
0 commit comments