Skip to content

Commit

Permalink
Revise
Browse files Browse the repository at this point in the history
  • Loading branch information
Tao-VanJS committed Oct 28, 2023
1 parent e53ab54 commit d5c6076
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,12 @@ _Author: [@Hunter-Gu](https://github.com/Hunter-Gu)_
#### Signature

```js
Await(
{
value, // A `Promise` object for asynchronous data
container, // The container of the result. Default `div`
Loading, // What to render when the data is being loaded
Error, // What to render when error occurs
},
children,
) => <The created UI element>
Await({
value, // A `Promise` object for asynchronous data
container, // The container of the result. Default `div`
Loading, // What to render when the data is being loaded
Error, // What to render when error occurs
}, children) => <The created UI element>
```

The `children` parameter (type: `(data: T) => ValidChildDomValue`) is a function that takes the resolved data as input and returns a valid child DOM value (`Node`, primitives, `null` or `undefined`), used to indicate what to render after the data is loaded.
Expand Down

0 comments on commit d5c6076

Please sign in to comment.