Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/content/learn/conditional-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,10 @@ If you're not familiar with JavaScript, this variety of styles might seem overwh
* In React, you control branching logic with JavaScript.
* You can return a JSX expression conditionally with an `if` statement.
* You can conditionally save some JSX to a variable and then include it inside other JSX by using the curly braces.
* In JSX, `{cond ? <A /> : <B />}` means *"if `cond`, render `<A />`, otherwise `<B />`"*.
* In JSX, `{cond && <A />}` means *"if `cond`, render `<A />`, otherwise nothing"*.
* In JSX, `{cond ? <A /> : <B />}` means:
<br/>*"if `cond`, render `<A />`, otherwise `<B />`"*.
* In JSX, `{cond && <A />}` means:
<br/>*"if `cond`, render `<A />`, otherwise `cond` or nothing if `cond` is either `null`, `undefined` or an empty string"*.
* The shortcuts are common, but you don't have to use them if you prefer plain `if`.

</Recap>
Expand Down
Loading