乐趣区

关于react.js:React-completeUnitOfWork

completeUnitOfWork: 失去要更新的 Fiber,造成链表

params

  1. unitOfWork

代码

if (returnFiber !== null && (returnFiber.flags & Incomplete) === NoFlags) {if (returnFiber.firstEffect === null) {returnFiber.firstEffect = completedWork.firstEffect;}

  if (completedWork.lastEffect !== null) {if (returnFiber.lastEffect !== null) {returnFiber.lastEffect.nextEffect = completedWork.firstEffect;}

    returnFiber.lastEffect = completedWork.lastEffect;
  }

  var flags = completedWork.flags;

  if (flags > PerformedWork) {if (returnFiber.lastEffect !== null) {returnFiber.lastEffect.nextEffect = completedWork;} else {returnFiber.firstEffect = completedWork;}

    returnFiber.lastEffect = completedWork;
  }
}
退出移动版