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

Function pushContextProvider

code/dependency-injection/public/app.js:12519–12537  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

12517 }
12518
12519 function pushContextProvider(workInProgress) {
12520 if (!isContextProvider(workInProgress)) {
12521 return false;
12522 }
12523
12524 var instance = workInProgress.stateNode;
12525 // We push the context as early as possible to ensure stack integrity.
12526 // If the instance does not exist yet, we will push null at first,
12527 // and replace it on the stack later when invalidating the context.
12528 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
12529
12530 // Remember the parent context so we can merge with it later.
12531 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
12532 previousContext = contextStackCursor.current;
12533 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
12534 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
12535
12536 return true;
12537 }
12538
12539 function invalidateContextProvider(workInProgress, didChange) {
12540 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected