Last active
August 30, 2018 14:59
-
-
Save pburtchaell/46af36a886e032035e60074d446e5990 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 leftText = "Hello" | |
// using props.chilren | |
const Button = (props) => ( | |
<div> | |
{props.children} | |
</div> | |
) | |
<Button> | |
{leftText} | |
</Button> | |
// OR, but not a good pattern | |
<Button children={leftText} /> | |
// using props.leftText | |
const OtherButton = (props) => ( | |
<div> | |
{props.buttonText} | |
</div> | |
) | |
<OtherButton buttonText={leftText} /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment