Chapter 7. Updating Your React Components
In the previous chapter, you learned that a React component can go through three phases:
- Mounting
- Updating
- Unmounting
We've already discussed the mounting and unmounting phases. In this chapter, we'll focus on the updating phase. During this phase, a React component is already inserted into the DOM. This DOM represents a component's current state, and when that state changes, React needs to evaluate how a new state is going to mutate the previously rendered DOM.
React provides us with methods to influence what is going to be rendered during an update as well as to be aware of when an update happens. These methods allow us to control the transition from the current component's state to the next component's state. ...
Get React 16 Essentials - Second Edition 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.