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

Function unwindWork

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

Source from the content-addressed store, hash-verified

22688 }
22689
22690 function unwindWork(current, workInProgress, renderLanes) {
22691 // Note: This intentionally doesn't check if we're hydrating because comparing
22692 // to the current tree provider fiber is just as fast and less error-prone.
22693 // Ideally we would have a special version of the work loop only
22694 // for hydration.
22695 popTreeContext(workInProgress);
22696
22697 switch (workInProgress.tag) {
22698 case ClassComponent:
22699 {
22700 var Component = workInProgress.type;
22701
22702 if (isContextProvider(Component)) {
22703 popContext(workInProgress);
22704 }
22705
22706 var flags = workInProgress.flags;
22707
22708 if (flags & ShouldCapture) {
22709 workInProgress.flags = flags & ~ShouldCapture | DidCapture;
22710
22711 if ( (workInProgress.mode & ProfileMode) !== NoMode) {
22712 transferActualDuration(workInProgress);
22713 }
22714
22715 return workInProgress;
22716 }
22717
22718 return null;
22719 }
22720
22721 case HostRoot:
22722 {
22723 var root = workInProgress.stateNode;
22724 popHostContainer(workInProgress);
22725 popTopLevelContextObject(workInProgress);
22726 resetWorkInProgressVersions();
22727 var _flags = workInProgress.flags;
22728
22729 if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
22730 // There was an error during render that wasn't captured by a suspense
22731 // boundary. Do a second pass on the root to unmount the children.
22732 workInProgress.flags = _flags & ~ShouldCapture | DidCapture;
22733 return workInProgress;
22734 } // We unwound to the root without completing it. Exit.
22735
22736
22737 return null;
22738 }
22739
22740 case HostComponent:
22741 {
22742 // TODO: popHydrationState
22743 popHostContext(workInProgress);
22744 return null;
22745 }
22746
22747 case SuspenseComponent:

Callers 1

completeUnitOfWorkFunction · 0.70

Calls 12

popTreeContextFunction · 0.70
isContextProviderFunction · 0.70
popContextFunction · 0.70
transferActualDurationFunction · 0.70
popHostContainerFunction · 0.70
popTopLevelContextObjectFunction · 0.70
popHostContextFunction · 0.70
popSuspenseContextFunction · 0.70
resetHydrationStateFunction · 0.70
popProviderFunction · 0.70
popRenderLanesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…