Last active
July 28, 2019 18:54
-
-
Save maxsimych/ff7273f89d5a2a35240993db085ca7a3 to your computer and use it in GitHub Desktop.
condition&&expression construction JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| true && expression always evaluates to expression, and false && expression always evaluates to false. | |
| (Therefore, if the condition is true, the element right after && will appear in the output. If it is false, React will ignore and skip it) | |
| JSX example: | |
| <div> | |
| <h1>Hello!</h1> | |
| {unreadMessages.length > 0 && | |
| <h2> | |
| You have {unreadMessages.length} unread messages. | |
| </h2> | |
| } | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment