Last active
September 25, 2017 21:40
-
-
Save benmvp/b4ddf43acb7c1dbc0ff9ced1aa4a2c02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pass the children back to the component to be used | |
// in the final render | |
const Enhancer = ({render, children, foo}) => ( | |
<div>{render(foo * 2, children)}</div> | |
) | |
// ViewComp uses both `render` & `children` 🙃 | |
const ViewComp = () => ( | |
<Enhancer foo={11} render={(value, children) => (<div>{value} - <span>{children}</span></div>)}> | |
Here's some children content | |
</Enhancer> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment