Want a new VS Code theme?

What happens when you call setState?

August 02, 2018

When you call setState, React takes the data you passed in and merges it into the current state of your component. This kicks off a process to update the DOM in the most efficient way possible.

To perform this update, React renders a tree of components in the virtual DOM, diffs the tree against the previous one, and updates the actual UI where necessary.