Dec 26, 2021
A lot of people seem to be confused by this. When you wrap provider in another node, this node is still a root of its subtree and on every update React will still perform diff of the subtree below. So in this particular example you’re trading invocation of console’s log to a diff function starting from parent which isn’t clever trade. If you inspect your components from the first example you will see that even though console log was called nothing really has been updated in the DOM, and by doing this you initiated diff function on the lower level and I guarantee that your first example is more performant