Last active
October 10, 2017 23:39
-
-
Save danny-andrews/b5b62a2b9c8237af7d3d61537499255c to your computer and use it in GitHub Desktop.
React Abstractions: Compare render props
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 LuckyNumber = ({ render }) => render({ number: Math.random() }); | |
const App = ({ message }) => ( | |
<LuckyNumber | |
render={({number}) => <div>{message}: {number}!</div>} | |
/> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment