How does React handle updates ?
How React Communicates With the Renderer ?
the renderer that handles the updates
setState calls renderer
The Update
- When we call setState, React adds the passed data to a queue.
- The updates are later handled one by one, but the changes are all applied at the same time.
React updates are closely related to React Fiber.
☘️ All of the updates are processed in two phases.
- During the first(render) phase, React calculates the new state and creates a list of effects.(those effects will handled during the second phase)
- Effect = activity like DOM mutation or Lifecycle method call
- 标签:render,getDerivedStateFromProps,Work,Actually,React,state,phase,called From: https://www.cnblogs.com/openmind-ink/p/18651991