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

Function pushContextProvider

code/third-party/public/app.js:11659–11677  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

11657 }
11658
11659 function pushContextProvider(workInProgress) {
11660 if (!isContextProvider(workInProgress)) {
11661 return false;
11662 }
11663
11664 var instance = workInProgress.stateNode;
11665 // We push the context as early as possible to ensure stack integrity.
11666 // If the instance does not exist yet, we will push null at first,
11667 // and replace it on the stack later when invalidating the context.
11668 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
11669
11670 // Remember the parent context so we can merge with it later.
11671 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
11672 previousContext = contextStackCursor.current;
11673 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
11674 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
11675
11676 return true;
11677 }
11678
11679 function invalidateContextProvider(workInProgress, didChange) {
11680 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected