Component Lifecycle Events

In a React application, components are created dynamically, according to the evolution of the application at runtime. A user's interaction starts a component's creation, its visualization, its updates on the screen, and its destruction.

So, components go through different phases during application execution: these phases represent their lifecycles.

React allows us to intercept and manage the phases of a component's lifecycle in a customized way, thanks to a set of events that we can handle by implementing specific methods.

Before analyzing a component's lifecycle events, we should highlight that the first step in creating a component is the execution of its constructor. Although it is not one of React's lifecycle ...

Get Beginning React now with O’Reilly online learning.

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