Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pedronauck/react-adopt
Browse files Browse the repository at this point in the history
* 'master' of github.com:pedronauck/react-adopt:
  chore: add context api demo on readme
  • Loading branch information
pedronauck committed Apr 3, 2018
2 parents 18d7ce1 + 9011069 commit 1cb0f98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- [Why](#--why)
- [Solution](#--solution)
- [Demos](#--demos)
- [Usage](#--usage-demo)
- [Working with new Context api](#working-with-new-context-api)
- [Custom render and retrieving props from composed](#custom-render-and-retrieving-props-from-composed)
Expand All @@ -33,6 +34,7 @@ React Adopt is just a simple method that you can compose your components and ret

- [Basic example](https://codesandbox.io/s/vq1wl37m0y?hidenavigation=1)
- [Todo App example using React Apollo](https://codesandbox.io/s/3x7n8wyp15?hidenavigation=1)
- [Example with new Context API](https://codesandbox.io/s/qv3m6yk2n4?hidenavigation=1)

## 💻   Usage

Expand Down Expand Up @@ -67,6 +69,8 @@ const Context = adopt({
</Context>
```

See [this demo](https://codesandbox.io/s/qv3m6yk2n4?hidenavigation=1) for a better comprehension

### Custom render and retrieving props from composed

Some components don't use the `children` property as render props. For cases like that, you can pass a function as mapper value that will return your component. This function will receive as props the `render` method, the props passed on `Composed` component and the previous values from each mapper. See an example:
Expand Down

0 comments on commit 1cb0f98

Please sign in to comment.