According to Facebook's Reconciliation documentation (https://facebook.github.io/react/docs/reconciliation.html)
"React's key design decision is to make the API seem like it re-renders the whole app on every update."
Thus, whenever the setState
() method is called on an object, that particular node is marked. At the end of the event loop, all the nodes are re-rendered where the setState
() method is called.
React is fast because it never talks to the DOM directly. It maintains an in-memory representation of the actual DOM. Whenever the render()
method is called, it returns a mapping of the actual DOM. React can detect (using a diff algorithm) changes in the mapped DOM compared to the in-memory representation. It then re-renders the changes and updates the UI likewise.
The event ecosystem in React is implemented by a full synthetic event system (SyntheticEvent()
). Cross-browser efficiency is achieved as all the events bubble up consistently.
In the current chapter, we have explored the stateful...