Last active
June 18, 2018 15:55
-
-
Save dangreenisrael/b309db3b622138fb8ff9245342849723 to your computer and use it in GitHub Desktop.
Conditional Render
This file contains hidden or 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 A = () => <h1> Foo </h1> | |
const B = () => <h1> Bar </h1> | |
const AorB = props => props.isBusinessOwner ? <A> : <B>; | |
const Parent = props => ( | |
<div> | |
Haaaaay!!! | |
<AorB isBusinessOwner={props.isBusinessOwner}/> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment