React - Conditional Rendering
¡Supera tus tareas y exámenes ahora con Quizwiz!
Inline If with Logical && Operator
must be inside { } to conditionally render React element
Preventing Component from Rendering
return null; instead of return React component. Note: Returning null from a component's render method does not affect the firing of the component's lifecycle methods. For instance, componentWillUpdate and componentDidUpdate will still be called.
If - else
to conditionally render part/all React elements
true && expression
= expression
false && expression
= false