Guest User

Untitled

a guest
Nov 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function completeUnitOfWork(workInProgress) {
  2. while (true) {
  3. let returnFiber = workInProgress.return;
  4. let siblingFiber = workInProgress.sibling;
  5.  
  6. nextUnitOfWork = completeWork(workInProgress);
  7.  
  8. if (siblingFiber !== null) {
  9. // If there is a sibling, return it
  10. // to perform work for this sibling
  11. return siblingFiber;
  12. } else if (returnFiber !== null) {
  13. // If there's no more work in this returnFiber,
  14. // continue the loop to complete the parent.
  15. workInProgress = returnFiber;
  16. continue;
  17. } else {
  18. // We've reached the root.
  19. return null;
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment