A

Admin • 828.03K Points
Coach

Q. How can you conditionally render a component in React?

  • (A) Using if statement outside JSX
  • (B) Using ternary operator or logical && inside JSX
  • (C) Using a loop
  • (D) You cannot conditionally render in React
  • Correct Answer - Option(B)
  • Views: 13
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin
Conditional rendering in JSX is commonly done using ternary or &&.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.