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/8840b7ce96454af4986769b299c10862 to your computer and use it in GitHub Desktop.
Save danny-andrews/8840b7ce96454af4986769b299c10862 to your computer and use it in GitHub Desktop.
const LuckyNumber = ({ component: Component, componentProps }) => <Component number={Math.random()} {...componentProps} />;
const AppBody = ({ message, number }) => <div>{message}: {number}!</div>;
const App = ({ message }) => <LuckyNumber componentProps={{ message }} component={AppBody} />;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment