React | Conditional Rendering | Question 8

Last Updated :
Discuss
Comments

How would you write a conditional rendering to display a "Loading..." message if isLoading is true and show Content if it is false?

{isLoading && "Loading..." || "Content"}

{isLoading ? "Loading..." : "Content"}

{!isLoading && "Loading..." ? "Content" : ""}

{isLoading && return "Loading..." : "Content"}

Share your thoughts in the comments