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

Function invalidateContextProvider

code/redux/public/app.js:12697–12719  ·  view source on GitHub ↗
(workInProgress, didChange)

Source from the content-addressed store, hash-verified

12695 }
12696
12697 function invalidateContextProvider(workInProgress, didChange) {
12698 var instance = workInProgress.stateNode;
12699 !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;
12700
12701 if (didChange) {
12702 // Merge parent and own context.
12703 // Skip this if we're not updating due to sCU.
12704 // This avoids unnecessarily recomputing memoized values.
12705 var mergedContext = processChildContext(workInProgress, previousContext);
12706 instance.__reactInternalMemoizedMergedChildContext = mergedContext;
12707
12708 // Replace the old (or empty) context with the new one.
12709 // It is important to unwind the context in the reverse order.
12710 pop(didPerformWorkStackCursor, workInProgress);
12711 pop(contextStackCursor, workInProgress);
12712 // Now push the new context and mark that it has changed.
12713 push(contextStackCursor, mergedContext, workInProgress);
12714 push(didPerformWorkStackCursor, didChange, workInProgress);
12715 } else {
12716 pop(didPerformWorkStackCursor, workInProgress);
12717 push(didPerformWorkStackCursor, didChange, workInProgress);
12718 }
12719 }
12720
12721 function findCurrentUnmaskedContext(fiber) {
12722 // 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