You get a bonus - 1 coin for daily activity. Now you have 1 coin

What are inline conditional expressions in REACT?

Practice



You can use the if statements or ternary expressions available in JS to render expressions conditionally. Apart from these approaches, you can also embed any expression in JSX by wrapping it in curly braces and then following it with a JS logical operator
&&
.

<h1>Hello!</h1>
{
    messages.length > 0 && !isLogin?
      <h2>
          You have {messages.length} unread messages.
      </h2>
      :
      <h2>
          You don't have unread messages.
      </h2>
}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone