Last active
December 4, 2017 16:39
-
-
Save danny-andrews/340660e5f76b962f7698927d182b080a to your computer and use it in GitHub Desktop.
React Abstractions: HoC example
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 withLuckyNumber = Component => (props) => <Component number={Math.random()} {...props} />; | |
const UnconnectedApp = ({ number }) => <div>Your number is: {number}!</div>; | |
const App = withLuckyNumber(UnconnectedApp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment