MCPcopy Create free account
hub / github.com/plotly/dash / completeWork

Function completeWork

dash/deps/react-dom@18.3.1.js:22113–22688  ·  view source on GitHub ↗
(current, workInProgress, renderLanes)

Source from the content-addressed store, hash-verified

22111 }
22112
22113 function completeWork(current, workInProgress, renderLanes) {
22114 var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing
22115 // to the current tree provider fiber is just as fast and less error-prone.
22116 // Ideally we would have a special version of the work loop only
22117 // for hydration.
22118
22119 popTreeContext(workInProgress);
22120
22121 switch (workInProgress.tag) {
22122 case IndeterminateComponent:
22123 case LazyComponent:
22124 case SimpleMemoComponent:
22125 case FunctionComponent:
22126 case ForwardRef:
22127 case Fragment:
22128 case Mode:
22129 case Profiler:
22130 case ContextConsumer:
22131 case MemoComponent:
22132 bubbleProperties(workInProgress);
22133 return null;
22134
22135 case ClassComponent:
22136 {
22137 var Component = workInProgress.type;
22138
22139 if (isContextProvider(Component)) {
22140 popContext(workInProgress);
22141 }
22142
22143 bubbleProperties(workInProgress);
22144 return null;
22145 }
22146
22147 case HostRoot:
22148 {
22149 var fiberRoot = workInProgress.stateNode;
22150 popHostContainer(workInProgress);
22151 popTopLevelContextObject(workInProgress);
22152 resetWorkInProgressVersions();
22153
22154 if (fiberRoot.pendingContext) {
22155 fiberRoot.context = fiberRoot.pendingContext;
22156 fiberRoot.pendingContext = null;
22157 }
22158
22159 if (current === null || current.child === null) {
22160 // If we hydrated, pop so that we can delete any remaining children
22161 // that weren't hydrated.
22162 var wasHydrated = popHydrationState(workInProgress);
22163
22164 if (wasHydrated) {
22165 // If we hydrated, then we'll need to schedule an update for
22166 // the commit side-effects on the root.
22167 markUpdate(workInProgress);
22168 } else {
22169 if (current !== null) {
22170 var prevState = current.memoizedState;

Callers 1

completeUnitOfWorkFunction · 0.70

Calls 15

popTreeContextFunction · 0.70
bubblePropertiesFunction · 0.70
isContextProviderFunction · 0.70
popContextFunction · 0.70
popHostContainerFunction · 0.70
popTopLevelContextObjectFunction · 0.70
popHydrationStateFunction · 0.70
markUpdateFunction · 0.70
popHostContextFunction · 0.70
getRootHostContainerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…