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

Function invalidateContextProvider

code/composition/public/app.js:12584–12606  ·  view source on GitHub ↗
(workInProgress, didChange)

Source from the content-addressed store, hash-verified

12582 }
12583
12584 function invalidateContextProvider(workInProgress, didChange) {
12585 var instance = workInProgress.stateNode;
12586 !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0;
12587
12588 if (didChange) {
12589 // Merge parent and own context.
12590 // Skip this if we're not updating due to sCU.
12591 // This avoids unnecessarily recomputing memoized values.
12592 var mergedContext = processChildContext(workInProgress, previousContext);
12593 instance.__reactInternalMemoizedMergedChildContext = mergedContext;
12594
12595 // Replace the old (or empty) context with the new one.
12596 // It is important to unwind the context in the reverse order.
12597 pop(didPerformWorkStackCursor, workInProgress);
12598 pop(contextStackCursor, workInProgress);
12599 // Now push the new context and mark that it has changed.
12600 push(contextStackCursor, mergedContext, workInProgress);
12601 push(didPerformWorkStackCursor, didChange, workInProgress);
12602 } else {
12603 pop(didPerformWorkStackCursor, workInProgress);
12604 push(didPerformWorkStackCursor, didChange, workInProgress);
12605 }
12606 }
12607
12608 function findCurrentUnmaskedContext(fiber) {
12609 // Currently this is only used with renderSubtreeIntoContainer; not sure if it

Callers 1

finishClassComponentFunction · 0.70

Calls 4

invariantFunction · 0.70
processChildContextFunction · 0.70
popFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected