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: README.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Install as project dependency:
44
44
$ yarn add react-adopt
45
45
```
46
46
47
-
Now you can use adopt to compose your components. See above an example using the awesome [react-powerplug](https://github.com/renatorib/react-powerplug):
47
+
Now you can use adopt to compose your components. See bellow an example using the awesome [react-powerplug](https://github.com/renatorib/react-powerplug):
48
48
49
49

50
50
@@ -73,7 +73,7 @@ See [this demo](https://codesandbox.io/s/qv3m6yk2n4?hidenavigation=1) for a bett
73
73
74
74
### Custom render and retrieving props from composed
75
75
76
-
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:
76
+
Some components don't use the prop called `children`to make work render props. For cases like that, when you define your mapper you can pass a simple function as mapper value that will return your component, instead of a jsx element. This function will receive a prop `render`that will be responsible to make render, the props passed on `Composed` component and the previous values from each mapper. See an example:
77
77
78
78
```js
79
79
import { adopt } from'react-adopt'
@@ -110,6 +110,28 @@ const Composed = adopt({
110
110
</Composed>
111
111
```
112
112
113
+
And get previous mapper results as prop for compose:
Some render props components return multiple arguments in the children function instead of single one, a simple example in the new [Query](https://www.apollographql.com/docs/react/essentials/queries.html#basic) and [Mutation](https://www.apollographql.com/docs/react/essentials/mutations.html) component from `react-apollo`. In that case, what you can do is a arbitrary render with `render` prop [using you map value as a function](#custom-render-and-retrieving-props-from-composed):
0 commit comments