Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function completeUnitOfWork(workInProgress) {
- while (true) {
- let returnFiber = workInProgress.return;
- let siblingFiber = workInProgress.sibling;
- nextUnitOfWork = completeWork(workInProgress);
- if (siblingFiber !== null) {
- // If there is a sibling, return it
- // to perform work for this sibling
- return siblingFiber;
- } else if (returnFiber !== null) {
- // If there's no more work in this returnFiber,
- // continue the loop to complete the parent.
- workInProgress = returnFiber;
- continue;
- } else {
- // We've reached the root.
- return null;
- }
- }
- }
Add Comment
Please, Sign In to add comment