Last active
October 11, 2017 18:16
-
-
Save danny-andrews/6798a45386a80f8a3865247146693fbe to your computer and use it in GitHub Desktop.
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 = ({ component: Component }) => <Component number={Math.random()} />; | |
// There's no general way to curry named parameters, so we have to do it | |
// manually. | |
const AppBody = ({ message }) => ({ number }) => <div>{message}: {number}!</div>; | |
const App = ({ message }) => <LuckyNumber component={AppBody({ message })} />; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment