KITFORMA · EDITORIAL ANSWER
Why does React render a stray zero before an empty list?
KitForma editorial guide. items.length && <List /> evaluates to numeric zero when the list is empty, and React renders that number.
Step-by-step answer
items.length && <List /> evaluates to numeric zero when the list is empty, and React renders that number. Use items.length > 0 && <List /> or a ternary with null. Check other numeric conditions such as unreadCount. Verify both zero and nonzero values. Boolean false, null and undefined can represent no output; the number 0 remains legitimate renderable content.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This editorial answer was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.