MCPcopy Create free account
hub / github.com/reactjs/react-rails / performUnitOfWork

Function performUnitOfWork

lib/assets/react-source/development/react.js:25838–25865  ·  view source on GitHub ↗
(unitOfWork)

Source from the content-addressed store, hash-verified

25836 }
25837
25838 function performUnitOfWork(unitOfWork) {
25839 // The current, flushed, state of this fiber is the alternate. Ideally
25840 // nothing should rely on this, but relying on it here means that we don't
25841 // need an additional field on the work in progress.
25842 var current = unitOfWork.alternate;
25843 startWorkTimer(unitOfWork);
25844 setCurrentFiber(unitOfWork);
25845 var next;
25846
25847 if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
25848 startProfilerTimer(unitOfWork);
25849 next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
25850 stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
25851 } else {
25852 next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
25853 }
25854
25855 resetCurrentFiber();
25856 unitOfWork.memoizedProps = unitOfWork.pendingProps;
25857
25858 if (next === null) {
25859 // If this doesn't spawn new work, complete the current work.
25860 next = completeUnitOfWork(unitOfWork);
25861 }
25862
25863 ReactCurrentOwner$2.current = null;
25864 return next;
25865 }
25866
25867 function completeUnitOfWork(unitOfWork) {
25868 // Attempt to complete the current unit of work, then move to the next

Callers 2

workLoopSyncFunction · 0.85
workLoopConcurrentFunction · 0.85

Calls 6

startWorkTimerFunction · 0.85
setCurrentFiberFunction · 0.85
startProfilerTimerFunction · 0.85
resetCurrentFiberFunction · 0.85
completeUnitOfWorkFunction · 0.85

Tested by

no test coverage detected