Last active
October 10, 2017 22:52
-
-
Save danny-andrews/e214e127c9610b54dea735b932edf396 to your computer and use it in GitHub Desktop.
React Abstractions: Render Prop
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 = () => ( | |
<LuckyNumber | |
render={({number}) => <div>Your number is: {number}!</div>} | |
/> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment