Skip to content

Instantly share code, notes, and snippets.

@JWLangford
Last active March 4, 2022 04:57
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