Last active
March 4, 2022 04:57
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 ConditionalExample = () => { | |
const name = "Jesse" | |
const condition = true | |
const number = 2 | |
const list = ["item"] | |
return ( | |
<div> | |
<div>Name: {name && <span>There is a name</span>} </div> | |
<div>Condition: {condition && <span>The condition is true</span> }</div> | |
<div>Number: {number && <span>There is a number</span>} </div> | |
<div>List: {list.length && <span>There is a length</span>} </div> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment