No, React will not go through the whole tree when you call setState only on the leaf node.
When calling setState, the reaction will only re-render the component (tree node) for which setState was called, and any components (nodes) that are children. It should be noted that React will only update the DOM if there really is a change that needs to be introduced in the setState call.
Vjeux, a member of the React team, wrote a nice blog post that details how the diff reaction algorithm works and how it works when you call setState. Here is the link .
Mike wilcox
source share