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

Function pushContextProvider

code/event-handlers/public/app.js:11756–11774  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

11754 }
11755
11756 function pushContextProvider(workInProgress) {
11757 if (!isContextProvider(workInProgress)) {
11758 return false;
11759 }
11760
11761 var instance = workInProgress.stateNode;
11762 // We push the context as early as possible to ensure stack integrity.
11763 // If the instance does not exist yet, we will push null at first,
11764 // and replace it on the stack later when invalidating the context.
11765 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
11766
11767 // Remember the parent context so we can merge with it later.
11768 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
11769 previousContext = contextStackCursor.current;
11770 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
11771 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
11772
11773 return true;
11774 }
11775
11776 function invalidateContextProvider(workInProgress, didChange) {
11777 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected