MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / performUnitOfWork

Function performUnitOfWork

code/third-party/public/app.js:12449–12482  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

12447 }
12448
12449 function performUnitOfWork(workInProgress) {
12450 // The current, flushed, state of this fiber is the alternate.
12451 // Ideally nothing should rely on this, but relying on it here
12452 // means that we don't need an additional field on the work in
12453 // progress.
12454 var current = workInProgress.alternate;
12455
12456 // See if beginning this work spawns more work.
12457 startWorkTimer(workInProgress);
12458 {
12459 ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
12460 }
12461
12462 if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
12463 stashedWorkInProgressProperties = _assign({}, workInProgress);
12464 }
12465 var next = beginWork(current, workInProgress, nextRenderExpirationTime);
12466
12467 {
12468 ReactDebugCurrentFiber.resetCurrentFiber();
12469 }
12470 if (true && ReactFiberInstrumentation_1.debugTool) {
12471 ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
12472 }
12473
12474 if (next === null) {
12475 // If this doesn't spawn new work, complete the current work.
12476 next = completeUnitOfWork(workInProgress);
12477 }
12478
12479 ReactCurrentOwner.current = null;
12480
12481 return next;
12482 }
12483
12484 function workLoop(isAsync) {
12485 if (!isAsync) {

Callers 1

workLoopFunction · 0.70

Calls 3

startWorkTimerFunction · 0.70
beginWorkFunction · 0.70
completeUnitOfWorkFunction · 0.70

Tested by

no test coverage detected