Closed
Description
Hi! What do you think about using conditional rendering in this form?
<div>
<h1>Hello!</h1>
{unreadMessages.length > 0 &&
<h2>
You have {unreadMessages.length} unread messages.
</h2>
}
</div>
(example from https://facebook.github.io/react/docs/conditional-rendering.html#inline-if-with-logical--operator)
Perhaps the rule should dictate a next style?
<div>
<h1>Hello!</h1>
{unreadMessages.length > 0 && (
<h2>
You have {unreadMessages.length} unread messages.
</h2>
)}
</div>
Now the first option will not lead to a warning. Even if it's right, what do you think about the first and second examples?