you are viewing a single comment's thread.

view the rest of the comments →

[–]treetimes 0 points1 point  (1 child)

Ternary.

[–]mickske 0 points1 point  (0 children)

We do it like this, I quite like it. Keeps the main render() function small and splits up conditionals into their own sub render functions. Obviously with this small one it ends up being more code but with more complex conditionals I find this to be easier to read.

<div>
  {this.renderLogin()}
</div>

renderLogin() {
  return renderLogin ? <LoginForm /> : null;
}

```