Skip to content

Commit 456ede1

Browse files
committed
chore: improve readme example
1 parent ba21c13 commit 456ede1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

README.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,22 @@ Install as project dependency:
2525
$ yarn add react-adopt
2626
```
2727

28-
Then you can use the method to compose your components
28+
Then you can use the method to compose your components. See above an example using the awesome library [react-powerplug](https://github.com/renatorib/react-powerplug):
2929

3030
```js
3131
import React from 'react'
32-
import { render } from 'react-dom'
3332
import { adopt } from 'react-adopt'
34-
35-
import { Filter } from './my-awesome-filter-component'
33+
import { Value } from 'react-powerplug'
3634

3735
const Composed = adopt({
38-
kids: <Filter list={people} by={p => p.age < 18} />,
39-
adults: <Filter list={people} by={p => p.age >= 18} />
36+
greet: <Value initial="Hello" />,
37+
name: <Value initial="John" />,
4038
})
4139

4240
const App = () => (
4341
<Composed>
44-
{({ kids, adults }) => (
45-
<div>
46-
<ul>{kids.map(p => <li>{p.name}</li>)}</ul>
47-
<ul>{adults.map(p => <li>{p.name}</li>)}</ul>
48-
</div>
42+
{({ greet, name }) => (
43+
<div>{greet.value} {name.value}</div>
4944
)}
5045
</Composed>
5146
)

0 commit comments

Comments
 (0)