O'Reilly logo

Mastering React by Ryan Vice, Adam Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Component Composition and Lifecycle

Now that we've covered the basics of creating components let's look at how we can compose our components to make more complex views. We will also look at how we can hook into a component's lifecycle events so that we can execute code before and after our component renders as well as prevent rendering based on incoming changes to state and props.

In this chapter we will be covering the following concepts:

  • Component composition
    • How to compose simple components
    • Composing components with behavior
    • How to access child components
  • Component lifecycle
    • Mounting and unmounting events
    • Updating events

How to compose simple components

One of the best things about React is that it is component based allowing us to easily ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required