Conditional Rendering
This lesson will teach you how to add Conditional Rendering in your application by using ternary operator.
We'll cover the following...
Conditional rendering is usually introduced early in React applications, though not in our working example. It happens when you decide to render either of two elements, which sometimes is a choice between rendering an element or nothing. The simplest usage of a conditional rendering can be expressed by an if-else statement in JSX.
The result
object in the local component state is null
in the beginning. So far, the App component returned no elements when the result
hasn’t arrived ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy