render()
|
|
V
updateContainer(element,container,parentComponent,callback)
|
|
V
requestUpdateLane(fiber) lane :例如 - 0b0000000001111111111111111000000
const schedulerPriority = getCurrentPriorityLevel();
const schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority)
lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
|
|
V
var update = createUpdate(eventTime, lane);
|
|
V
scheduleUpdateOnFiber(root, current$1, lane, eventTime);
|
|
V
const root = markUpdateLaneFromFiberToRoot(fiber, lane);
markRootUpdated(root: FiberRoot, updateLane: Lane, eventTime: number,)
root.pendingLanes |= updateLane;
|
|
V
ensureRootIsScheduled(root, eventTime);
var existingCallbackNode = root.callbackNode;
|
|
V
markStarvedLanesAsExpired(root, currentTime);
computeExpirationTime(lane, currentTime);
|
|
V
var nextLanes = getNextLanes(
root,
root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes
);
var existingCallbackNode = root.callbackNode;
var newCallbackPriority = returnNextLanesPriority();
var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));
|
|
V
performConcurrentWorkOnRoot(root, didTimeout)
ensureRootIsScheduled(root, now());
if (root.callbackNode === originalCallbackNode) {
return performConcurrentWorkOnRoot.bind(null, root);
}
return null;
return null;
function workLoopConcurrent() {
while (workInProgress !== null && !shouldYield()) {
performUnitOfWork(workInProgress);
}
}
|
|
V
commit()
......