Skip to content

Instantly share code, notes, and snippets.

@creimers
Created April 24, 2020 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creimers/7beec20e65db5d31b1849dba412989de to your computer and use it in GitHub Desktop.
Save creimers/7beec20e65db5d31b1849dba412989de to your computer and use it in GitHub Desktop.
react render props children
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