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

Function performUnitOfWork

code/styling/public/app.js:13216–13249  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

13214 }
13215
13216 function performUnitOfWork(workInProgress) {
13217 // The current, flushed, state of this fiber is the alternate.
13218 // Ideally nothing should rely on this, but relying on it here
13219 // means that we don't need an additional field on the work in
13220 // progress.
13221 var current = workInProgress.alternate;
13222
13223 // See if beginning this work spawns more work.
13224 startWorkTimer(workInProgress);
13225 {
13226 ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
13227 }
13228
13229 if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
13230 stashedWorkInProgressProperties = _assign({}, workInProgress);
13231 }
13232 var next = beginWork(current, workInProgress, nextRenderExpirationTime);
13233
13234 {
13235 ReactDebugCurrentFiber.resetCurrentFiber();
13236 }
13237 if (true && ReactFiberInstrumentation_1.debugTool) {
13238 ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
13239 }
13240
13241 if (next === null) {
13242 // If this doesn't spawn new work, complete the current work.
13243 next = completeUnitOfWork(workInProgress);
13244 }
13245
13246 ReactCurrentOwner.current = null;
13247
13248 return next;
13249 }
13250
13251 function workLoop(isAsync) {
13252 if (!isAsync) {

Callers 1

workLoopFunction · 0.70

Calls 3

startWorkTimerFunction · 0.70
beginWorkFunction · 0.70
completeUnitOfWorkFunction · 0.70

Tested by

no test coverage detected