3. Conditional Rendering and for Loops


In this chapter, we will implement conditional rendering and various looping techniques in React. You will be able to use conditional rendering in your React application via inline ternaries in JSX and guard clauses. Furthermore, you will be able to programmatically design new components using for loops to create lists of components efficiently. Eventually, you will develop an application to handle complex states in React.


In the previous chapter, we have built applications with relatively complex forms and all of that featured information that always got displayed; as in, there was no hidden data involved. In many applications, however, there tends to be portions of the app ...

Get The React Workshop now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.