Created
April 24, 2020 14:43
-
-
Save creimers/7beec20e65db5d31b1849dba412989de to your computer and use it in GitHub Desktop.
react render props children
This file contains 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
const Ding = (props) => { | |
const {children} = props | |
return children( | |
{text: "dong"} | |
) | |
} | |
const Dong = () => ( | |
<Ding> | |
{({text}) => ( | |
<p>ding {text}</p> | |
)} | |
</Ding> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment