Skip to content

Instantly share code, notes, and snippets.

@danny-andrews
Last active October 11, 2017 18:16
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 danny-andrews/6798a45386a80f8a3865247146693fbe to your computer and use it in GitHub Desktop.
Save danny-andrews/6798a45386a80f8a3865247146693fbe to your computer and use it in GitHub Desktop.
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