Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
With && the left value is returned when it is falsy, and React renders the number 0; compare explicitly, for example items.length > 0 &&.
The && operator returns its left operand when that operand is falsy. React skips false, null and undefined, but it renders numbers, so an empty array produces the text 0. Write a boolean condition instead, such as items.length > 0 && , or use a ternary that returns null. The same issue appears with any number on the left side, so it is safest to keep the left side boolean.