Component Composition - Alwynblake/seattle-javascript-401n12 GitHub Wiki

Conditional rendering

  • You can create distinct components that encapsulate behavior you need. Then, you can render only some of them, depending on the state of your application.

  • Element Variables - You can use variables to store elements. This can help you conditionally render a part of the component while the rest of the output doesn’t change.

Inline If-Else with Conditional Operator

  • Another method for conditionally rendering elements inline is to use the JavaScript conditional operator condition ? true : false.