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

Function pushContextProvider

code/styling/public/app.js:12426–12444  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

12424 }
12425
12426 function pushContextProvider(workInProgress) {
12427 if (!isContextProvider(workInProgress)) {
12428 return false;
12429 }
12430
12431 var instance = workInProgress.stateNode;
12432 // We push the context as early as possible to ensure stack integrity.
12433 // If the instance does not exist yet, we will push null at first,
12434 // and replace it on the stack later when invalidating the context.
12435 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
12436
12437 // Remember the parent context so we can merge with it later.
12438 // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
12439 previousContext = contextStackCursor.current;
12440 push(contextStackCursor, memoizedMergedChildContext, workInProgress);
12441 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
12442
12443 return true;
12444 }
12445
12446 function invalidateContextProvider(workInProgress, didChange) {
12447 var instance = workInProgress.stateNode;

Callers

nothing calls this directly

Calls 2

isContextProviderFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected