There are two steps of what we may call render
:
- Virtual DOM render: when
render
method is called it returns a new virtual dom structure of the component. Thisrender
method is called always when you callsetState()
, becauseshouldComponentUpdate
always returns true by default. So, by default, there is no optimisation here in React. - Native DOM render: React changes real DOM nodes in your browser only if they were changed in the Virtual DOM and as little as needed – this is that great React’s feature which optimizes real DOM mutation and makes React fast.