MCPcopy Create free account
hub / github.com/plotly/dash / performUnitOfWork

Function performUnitOfWork

dash/deps/react-dom@18.3.1.js:26596–26623  ·  view source on GitHub ↗
(unitOfWork)

Source from the content-addressed store, hash-verified

26594 }
26595
26596 function performUnitOfWork(unitOfWork) {
26597 // The current, flushed, state of this fiber is the alternate. Ideally
26598 // nothing should rely on this, but relying on it here means that we don't
26599 // need an additional field on the work in progress.
26600 var current = unitOfWork.alternate;
26601 setCurrentFiber(unitOfWork);
26602 var next;
26603
26604 if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
26605 startProfilerTimer(unitOfWork);
26606 next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
26607 stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
26608 } else {
26609 next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
26610 }
26611
26612 resetCurrentFiber();
26613 unitOfWork.memoizedProps = unitOfWork.pendingProps;
26614
26615 if (next === null) {
26616 // If this doesn't spawn new work, complete the current work.
26617 completeUnitOfWork(unitOfWork);
26618 } else {
26619 workInProgress = next;
26620 }
26621
26622 ReactCurrentOwner$2.current = null;
26623 }
26624
26625 function completeUnitOfWork(unitOfWork) {
26626 // Attempt to complete the current unit of work, then move to the next

Callers 2

workLoopSyncFunction · 0.70
workLoopConcurrentFunction · 0.70

Calls 5

setCurrentFiberFunction · 0.70
startProfilerTimerFunction · 0.70
resetCurrentFiberFunction · 0.70
completeUnitOfWorkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…