Skip to content

Commit 72885ff

Browse files
author
SayBGM
authored
Edit inline conditional expressions
Example of Inline Conditional Expression Fixes that source code is unnatural
1 parent a32a092 commit 72885ff

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,15 +561,17 @@
561561
```jsx harmony
562562
<h1>Hello!</h1>
563563
{
564-
messages.length > 0 &&
565-
<h2>
566-
You have {messages.length} unread messages.
567-
</h2>
564+
messages.length > 0 && !isLogin?
565+
<h2>
566+
You have {messages.length} unread messages.
567+
</h2>
568+
:
569+
<h2>
570+
You don't have unread messages.
571+
</h2>
568572
}
569573
```
570574
571-
<!-- TODO: fix this section -->
572-
573575
18. ### What are "key" props and what is the benefit of using them in arrays of elements?
574576
575577
A `key` is a special string attribute you **should** include when creating arrays of elements. *Keys* help React identify which items have changed, are added, or are removed.

0 commit comments

Comments
 (0)