dillon1000/react

Commit

Move Persistent Mode Optimization away from firstEffect (#19381)

Persistent mode needs to clone a parent and add its children if a child has
changed.

We have an optimization in persistent mode where we don't do that if no
child could've changed. If there are no effects scheduled for any child
then there couldn't have been changes.

Instead of checking for this on firstEffect, we now check this on the
children's effectTag and subtreeTags.

This is quite unfortunate because if we could just do this check a little
bit later we would've already gotten it transferred to the completed work's
subtreeTag. Now we have to loop over all the children and if any of them
changed, we have to loop over them again. Doing at least two loops per
parent.
Browse files
Changed paths1 file
First-parent comparison
M packages/react-reconciler/src/ReactFiberCompleteWork.new.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…