MCPcopy
hub / github.com/facebook/react / resolveRetryWakeable

Function resolveRetryWakeable

packages/react-reconciler/src/ReactFiberWorkLoop.js:4879–4914  ·  view source on GitHub ↗
(boundaryFiber: Fiber, wakeable: Wakeable)

Source from the content-addressed store, hash-verified

4877}
4878
4879export function resolveRetryWakeable(boundaryFiber: Fiber, wakeable: Wakeable) {
4880 let retryLane: Lane = NoLane; // Default
4881 let retryCache: WeakSet<Wakeable> | Set<Wakeable> | null;
4882 switch (boundaryFiber.tag) {
4883 case ActivityComponent:
4884 case SuspenseComponent:
4885 retryCache = boundaryFiber.stateNode;
4886 const suspenseState: null | SuspenseState | ActivityState =
4887 boundaryFiber.memoizedState;
4888 if (suspenseState !== null) {
4889 retryLane = suspenseState.retryLane;
4890 }
4891 break;
4892 case SuspenseListComponent:
4893 retryCache = boundaryFiber.stateNode;
4894 break;
4895 case OffscreenComponent: {
4896 const instance: OffscreenInstance = boundaryFiber.stateNode;
4897 retryCache = instance._retryCache;
4898 break;
4899 }
4900 default:
4901 throw new Error(
4902 'Pinged unknown suspense boundary type. ' +
4903 'This is probably a bug in React.',
4904 );
4905 }
4906
4907 if (retryCache !== null) {
4908 // The wakeable resolved, so we no longer need to memoize, because it will
4909 // never be thrown again.
4910 retryCache.delete(wakeable);
4911 }
4912
4913 retryTimedOutBoundary(boundaryFiber, retryLane);
4914}
4915
4916export function throwIfInfiniteUpdateLoopDetected() {
4917 if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {

Callers

nothing calls this directly

Calls 1

retryTimedOutBoundaryFunction · 0.85

Tested by

no test coverage detected