MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / completeWork

Function completeWork

code/redux/public/app.js:11051–11227  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

11049 }
11050
11051 function completeWork(current, workInProgress, renderExpirationTime) {
11052 var newProps = workInProgress.pendingProps;
11053 switch (workInProgress.tag) {
11054 case FunctionalComponent:
11055 return null;
11056 case ClassComponent:
11057 {
11058 // We are leaving this subtree, so pop context if any.
11059 popLegacyContextProvider(workInProgress);
11060
11061 // If this component caught an error, schedule an error log effect.
11062 var instance = workInProgress.stateNode;
11063 var updateQueue = workInProgress.updateQueue;
11064 if (updateQueue !== null && updateQueue.capturedValues !== null) {
11065 workInProgress.effectTag &= ~DidCapture;
11066 if (typeof instance.componentDidCatch === 'function') {
11067 workInProgress.effectTag |= ErrLog;
11068 } else {
11069 // Normally we clear this in the commit phase, but since we did not
11070 // schedule an effect, we need to reset it here.
11071 updateQueue.capturedValues = null;
11072 }
11073 }
11074 return null;
11075 }
11076 case HostRoot:
11077 {
11078 popHostContainer(workInProgress);
11079 popTopLevelLegacyContextObject(workInProgress);
11080 var fiberRoot = workInProgress.stateNode;
11081 if (fiberRoot.pendingContext) {
11082 fiberRoot.context = fiberRoot.pendingContext;
11083 fiberRoot.pendingContext = null;
11084 }
11085 if (current === null || current.child === null) {
11086 // If we hydrated, pop so that we can delete any remaining children
11087 // that weren't hydrated.
11088 popHydrationState(workInProgress);
11089 // This resets the hacky state to fix isMounted before committing.
11090 // TODO: Delete this when we delete isMounted and findDOMNode.
11091 workInProgress.effectTag &= ~Placement;
11092 }
11093 updateHostContainer(workInProgress);
11094
11095 var _updateQueue = workInProgress.updateQueue;
11096 if (_updateQueue !== null && _updateQueue.capturedValues !== null) {
11097 workInProgress.effectTag |= ErrLog;
11098 }
11099 return null;
11100 }
11101 case HostComponent:
11102 {
11103 popHostContext(workInProgress);
11104 var rootContainerInstance = getRootHostContainer();
11105 var type = workInProgress.type;
11106 if (current !== null && workInProgress.stateNode != null) {
11107 // If we have an alternate, that means this is an update and we need to
11108 // schedule a side-effect to do the updates.

Callers 1

completeUnitOfWorkFunction · 0.70

Calls 15

popHostContainerFunction · 0.70
popHydrationStateFunction · 0.70
popHostContextFunction · 0.70
getRootHostContainerFunction · 0.70
getHostContextFunction · 0.70
updateHostComponentFunction · 0.70
markRefFunction · 0.70
invariantFunction · 0.70
markUpdateFunction · 0.70
appendAllChildrenFunction · 0.70
updateHostTextFunction · 0.70

Tested by

no test coverage detected