MCPcopy Index your code
hub / github.com/microsoft/SandDance / invalidateContextProvider

Function invalidateContextProvider

docs/external/js/react-dom.development.js:10980–11008  ·  view source on GitHub ↗
(workInProgress, type, didChange)

Source from the content-addressed store, hash-verified

10978 }
10979
10980 function invalidateContextProvider(workInProgress, type, didChange) {
10981 {
10982 var instance = workInProgress.stateNode;
10983
10984 if (!instance) {
10985 {
10986 throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." );
10987 }
10988 }
10989
10990 if (didChange) {
10991 // Merge parent and own context.
10992 // Skip this if we're not updating due to sCU.
10993 // This avoids unnecessarily recomputing memoized values.
10994 var mergedContext = processChildContext(workInProgress, type, previousContext);
10995 instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
10996 // It is important to unwind the context in the reverse order.
10997
10998 pop(didPerformWorkStackCursor, workInProgress);
10999 pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
11000
11001 push(contextStackCursor, mergedContext, workInProgress);
11002 push(didPerformWorkStackCursor, didChange, workInProgress);
11003 } else {
11004 pop(didPerformWorkStackCursor, workInProgress);
11005 push(didPerformWorkStackCursor, didChange, workInProgress);
11006 }
11007 }
11008 }
11009
11010 function findCurrentUnmaskedContext(fiber) {
11011 {

Callers 1

finishClassComponentFunction · 0.85

Calls 3

processChildContextFunction · 0.85
popFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected