Closed
Description
We are making use of inline conditional guard statements a lot like:
<div>
{unreadMessages.length > 0 && <h2>Hey</h2>}
</div>
We often run into bugs where a string literal 0
is rendered, because a short hand notion was used, which react does not allow:
<div>
{unreadMessages.length && <h2>Hey</h2>}
</div>
React will not render a boolean value, while it does for integer values like 0 and 1.
If possible, I'd like to detect this pattern and flag it early. Apologies if this already exists, I checked for "conditional" and "inline" and couldn't find a match.