dillon1000/react

Commit

Move priority reset to the end and search pending work in work tree

The priority level gets reset at the wrong time because I rely
on mutating it at the wrong point. This moves it to the end of
completed work as a second pass over the children to see what
the highest priority is. This is inefficient for large sets but
we can try to find a smarter way to do this later. E.g. passing
it down the stack.

This bug fix revealed another bug that I had flagged before that
we're finding work to do in the "current" tree instead of the
working tree. For trees that were paused, e.g. childInProgress
trees, this won't work since don't have a current tree to search.

Therefore I fixed findNextUnitOfWorkAtPriority to use
workInProgress instead of current.
Browse files
Changed paths6 files
First-parent comparison
M src/renderers/shared/fiber/ReactChildFiber.js ModifiedM src/renderers/shared/fiber/ReactFiber.js ModifiedM src/renderers/shared/fiber/ReactFiberBeginWork.js ModifiedM src/renderers/shared/fiber/ReactFiberPendingWork.js ModifiedM src/renderers/shared/fiber/ReactFiberReconciler.js ModifiedM src/renderers/shared/fiber/ReactFiberScheduler.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…