Skip to content

Commit 111d0a2

Browse files
committed
Update README.md
1 parent 03f027a commit 111d0a2

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33
React component for declarative promise resolution and data fetching. Uses render props for full flexibility or React context
44
for convenience. Makes it easy to handle loading and error states, without assumptions about the shape of your data or the type of request. Supports optimistic updates.
55

6-
## Install
7-
8-
`npm install --save react-async`
9-
106
## Usage
117

128
Using render props for ultimate flexibility:
139

1410
```js
15-
import Async from "react-async"
16-
1711
const loadJson = () => fetch("/some/url").then(res => res.json())
1812

1913
const MyComponent = () => {
@@ -39,8 +33,6 @@ const MyComponent = () => {
3933
Using helper components (don't have to be direct children) for ease of use:
4034

4135
```js
42-
import Async from "react-async"
43-
4436
const loadJson = () => fetch("/some/url").then(res => res.json())
4537

4638
const MyComponent = () => {
@@ -151,7 +143,7 @@ const updateAttendance = attend => fetch(...).then(() => attend, () => !attend)
151143

152144
## Helper components
153145

154-
`Async` provides several helper components that make your JSX even more declarative.
146+
`<Async>` provides several helper components that make your JSX even more declarative.
155147
They don't have to be direct children of `<Async>` and you can use the same component several times.
156148

157149
### `<Async.Loading>`

0 commit comments

Comments
 (0)