Created
March 5, 2016 04:30
-
-
Save dandean/4018528327f5177e1c36 to your computer and use it in GitHub Desktop.
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
let i = 0; | |
class UsesConditional extends React.Component { | |
render() { | |
i++; | |
return ( | |
<div> | |
<Conditional if={i % 2}> | |
<span>Show Me</span> | |
</Conditional> | |
</div> | |
) | |
} | |
} | |
ReactDOM.render( | |
<UsesConditional />, | |
document.getElementById('container') | |
); |
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
let i = 0; | |
class UsesTernary extends React.Component { | |
render() { | |
i++; | |
return ( | |
<div> | |
{ | |
i % 2 ? | |
<span>Show Me</span> : | |
null | |
} | |
</div> | |
) | |
} | |
} | |
ReactDOM.render( | |
<UsesTernary />, | |
document.getElementById('container') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment