Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.