I\'ve read in the React docs that \"if\" type statements can\'t be used in JSX code, because of the way JSX renders into javascript, it doesn\'t work out as one would expect
You can do a self-executing function, with the right context too (with the help of Babel though)! Which I prefer because there's no need for assigning of variables and you can be as complex as you want (though you probably shouldn't for the sake of maintainability):
render() {
return (
Hello!
{() => {
if (this.props.isLoggedIn) {
return
} else {
return
}
}()}
Another Tag
);
}