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

Function completeWork

code/composition/public/app.js:10938–11114  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10936 }
10937
10938 function completeWork(current, workInProgress, renderExpirationTime) {
10939 var newProps = workInProgress.pendingProps;
10940 switch (workInProgress.tag) {
10941 case FunctionalComponent:
10942 return null;
10943 case ClassComponent:
10944 {
10945 // We are leaving this subtree, so pop context if any.
10946 popLegacyContextProvider(workInProgress);
10947
10948 // If this component caught an error, schedule an error log effect.
10949 var instance = workInProgress.stateNode;
10950 var updateQueue = workInProgress.updateQueue;
10951 if (updateQueue !== null && updateQueue.capturedValues !== null) {
10952 workInProgress.effectTag &= ~DidCapture;
10953 if (typeof instance.componentDidCatch === 'function') {
10954 workInProgress.effectTag |= ErrLog;
10955 } else {
10956 // Normally we clear this in the commit phase, but since we did not
10957 // schedule an effect, we need to reset it here.
10958 updateQueue.capturedValues = null;
10959 }
10960 }
10961 return null;
10962 }
10963 case HostRoot:
10964 {
10965 popHostContainer(workInProgress);
10966 popTopLevelLegacyContextObject(workInProgress);
10967 var fiberRoot = workInProgress.stateNode;
10968 if (fiberRoot.pendingContext) {
10969 fiberRoot.context = fiberRoot.pendingContext;
10970 fiberRoot.pendingContext = null;
10971 }
10972 if (current === null || current.child === null) {
10973 // If we hydrated, pop so that we can delete any remaining children
10974 // that weren't hydrated.
10975 popHydrationState(workInProgress);
10976 // This resets the hacky state to fix isMounted before committing.
10977 // TODO: Delete this when we delete isMounted and findDOMNode.
10978 workInProgress.effectTag &= ~Placement;
10979 }
10980 updateHostContainer(workInProgress);
10981
10982 var _updateQueue = workInProgress.updateQueue;
10983 if (_updateQueue !== null && _updateQueue.capturedValues !== null) {
10984 workInProgress.effectTag |= ErrLog;
10985 }
10986 return null;
10987 }
10988 case HostComponent:
10989 {
10990 popHostContext(workInProgress);
10991 var rootContainerInstance = getRootHostContainer();
10992 var type = workInProgress.type;
10993 if (current !== null && workInProgress.stateNode != null) {
10994 // If we have an alternate, that means this is an update and we need to
10995 // 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