(unitOfWork: Fiber)
| 2988 | } |
| 2989 | |
| 2990 | function performUnitOfWork(unitOfWork: Fiber): void { |
| 2991 | // The current, flushed, state of this fiber is the alternate. Ideally |
| 2992 | // nothing should rely on this, but relying on it here means that we don't |
| 2993 | // need an additional field on the work in progress. |
| 2994 | const current = unitOfWork.alternate; |
| 2995 | |
| 2996 | let next; |
| 2997 | if (enableProfilerTimer && (unitOfWork.mode & ProfileMode) !== NoMode) { |
| 2998 | startProfilerTimer(unitOfWork); |
| 2999 | if (__DEV__) { |
| 3000 | next = runWithFiberInDEV( |
| 3001 | unitOfWork, |
| 3002 | beginWork, |
| 3003 | current, |
| 3004 | unitOfWork, |
| 3005 | entangledRenderLanes, |
| 3006 | ); |
| 3007 | } else { |
| 3008 | next = beginWork(current, unitOfWork, entangledRenderLanes); |
| 3009 | } |
| 3010 | stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); |
| 3011 | } else { |
| 3012 | if (__DEV__) { |
| 3013 | next = runWithFiberInDEV( |
| 3014 | unitOfWork, |
| 3015 | beginWork, |
| 3016 | current, |
| 3017 | unitOfWork, |
| 3018 | entangledRenderLanes, |
| 3019 | ); |
| 3020 | } else { |
| 3021 | next = beginWork(current, unitOfWork, entangledRenderLanes); |
| 3022 | } |
| 3023 | } |
| 3024 | |
| 3025 | unitOfWork.memoizedProps = unitOfWork.pendingProps; |
| 3026 | if (next === null) { |
| 3027 | // If this doesn't spawn new work, complete the current work. |
| 3028 | completeUnitOfWork(unitOfWork); |
| 3029 | } else { |
| 3030 | workInProgress = next; |
| 3031 | } |
| 3032 | } |
| 3033 | |
| 3034 | function replaySuspendedUnitOfWork(unitOfWork: Fiber): void { |
| 3035 | // This is a fork of performUnitOfWork specifcally for replaying a fiber that |
no test coverage detected