React - Conditional Rendering
Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan 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