Chapter 3

Building React Components

IN THIS CHAPTER

Bullet Writing custom components

Bullet Returning valid data from components

Bullet Passing props

Bullet Finding the state

Bullet Implementing reactivity with functions and classes

Bullet Hooking into component lifecycle

Bullet Composing with components

“A good engineer thinks in reverse and asks himself about the stylistic consequences of the components and systems he proposes.”

—HELMUT JAHN

React components define React elements. In this lesson, I describe how React components work, how to pass data from parent components to child components, and how to assemble components to build increasingly complex components through a pattern called composition.

Thinking in Components

React components exist to describe an isolated piece of a user interface. So far in Book 3, each component ...

Get JavaScript All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.