Chapter 2. Baby steps with React

This chapter covers

  • Nesting elements
  • Creating a component class
  • Working with properties

This chapter will teach you how to take baby steps with React and lays the foundation for the following chapters. It’s crucial for understanding React concepts such as elements and components. In a nutshell, elements are instances of components (also called component classes). What are their use cases, and why do you use them? Read on!


The source code for the examples in this chapter is at and (in the ch02 folder of the GitHub repository You can also find some demos ...

Get React Quickly: Painless web apps with React, JSX, Redux, and GraphQL now with the O’Reilly learning platform.

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