MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / pushContextProvider

Function pushContextProvider

code/communication/public/app.js:12461–12479  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

12459 }
12460
12461 function pushContextProvider(workInProgress) {
12462 if (!isContextProvider(workInProgress)) {
12463 return false;
12464 }
12465
12466 var instance = workInProgress.stateNode;
12467 // We push the context as early as possible to ensure stack integrity.
12468 // If the instance does not exist yet, we will push null at first,
12469 // and replace it on the stack later when invalidating the context.
12470 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
12471
12472 // Remember the parent context so we can merge with it later.
12473 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
12474 previousContext = contextStackCursor.current;
12475 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
12476 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
12477
12478 return true;
12479 }
12480
12481 function invalidateContextProvider(workInProgress, didChange) {
12482 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected