dillon1000/react
Commit
Browse files Reused components commit with timing as new ones
When an Offscreen tree goes from hidden -> visible, the tree may include both reused components that were unmounted when the tree was hidden, and also brand new components that didn't exist in the hidden tree. Currently when this happens, we commit all the reused components' effects first, before committing the new ones, using two separate traversals of the tree. Instead, we should fire all the effects with the same timing as if it were a completely new tree. See the test I wrote for an example. This is also more efficient because we only need to traverse the tree once.
Changed paths3 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberCommitWork.new.js ModifiedM packages/react-reconciler/src/ReactFiberCommitWork.old.js ModifiedM packages/react-reconciler/src/__tests__/ReactOffscreen-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…