MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / pushContextProvider

Function pushContextProvider

code/new-context-api/public/app.js:11787–11805  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

11785 }
11786
11787 function pushContextProvider(workInProgress) {
11788 if (!isContextProvider(workInProgress)) {
11789 return false;
11790 }
11791
11792 var instance = workInProgress.stateNode;
11793 // We push the context as early as possible to ensure stack integrity.
11794 // If the instance does not exist yet, we will push null at first,
11795 // and replace it on the stack later when invalidating the context.
11796 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
11797
11798 // Remember the parent context so we can merge with it later.
11799 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
11800 previousContext = contextStackCursor.current;
11801 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
11802 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
11803
11804 return true;
11805 }
11806
11807 function invalidateContextProvider(workInProgress, didChange) {
11808 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected