Skip to content

Commit 1857b77

Browse files
committed
docs: clarify explanation of logical && in JSX
1 parent 2da4f7f commit 1857b77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/learn/conditional-rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default function PackingList() {
310310
311311
</Sandpack>
312312
313-
A [JavaScript && expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND) returns the value of its right side (in our case, the checkmark) if the left side (our condition) is `true`. But if the condition is `false`, the whole expression becomes `false`. React considers `false` as a "hole" in the JSX tree, just like `null` or `undefined`, and doesn't render anything in its place.
313+
A [JavaScript && expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND) returns the value of its right-hand side (in this case, the checkmark) when the left-hand side (the condition) is true. If the condition is false, the entire expression evaluates to false. React ignores false, null, and undefined when rendering JSX, so nothing is rendered in their place.
314314
315315
316316
<Pitfall>

0 commit comments

Comments
 (0)