Created
August 14, 2020 19:36
-
-
Save robertwbradford/879507fcac2f79149ea4edbea35d2b34 to your computer and use it in GitHub Desktop.
React Slot Pattern
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 Layout = ({ slot1, slot2 }) => { | |
return ( | |
<div> | |
<div>{slot1}</div> | |
<div>{slot2}</div> | |
</div> | |
); | |
}; | |
const MyApp = () => <Layout slot1={<p>Hello</p>} slot2={<p>world</p>} />; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment