I would like to know the following details about React Virtual DOM diffing, so here is a simple example:
So, the output of the React initial render would be the virtual DOM of the entire app which is kept in memory to represent the current state of the real DOM and to be diffed with the output of the second render. Let's say that in the second render, only one component state is updated (let's call it component A) and it gets re-rendered - the component function is called and the component virtual DOM is created from the returned JSX. Now comes the diffing part and my question: Are in diffing part only participating virtual DOM of component A from the initial render with the virtual DOM of component A from the second render, or the entire app virtual DOM from the initial render with the entire app virtual DOM from the second render? I am asking specifically for the diffing part, I am aware that not all components will go through the render phase if only one components state is updated.
If someone can please answer as accurately as possible, possibly with the provided source of the information, cause I found different information on the web on this subject, as well as here on StackOverflow. Thanks :)