render() {
const isLoggedIn = this.state.isLoggedIn;
return (
<div>
The user is <b>{isLoggedIn ? 'currently' : 'not'}</b> logged in. </div>
);
}
// Before your return / render block you could write something like this:
const ifThisOrThat = ifThis || ifThat;
// then you can use it in your return / render block like so:
{ ifThisOrThat &&
<p>I will render ifThis or ifThat is true!</p>
}
if (coinToss() === 'heads') {
img = <img src={pics.kitty} />
} else {
img = <img src={pics.doggy} />
}