MCPcopy
hub / github.com/plotly/dash / invalidateContextProvider

Function invalidateContextProvider

dash/deps/react-dom@18.2.0.js:11941–11967  ·  view source on GitHub ↗
(workInProgress, type, didChange)

Source from the content-addressed store, hash-verified

11939 }
11940
11941 function invalidateContextProvider(workInProgress, type, didChange) {
11942 {
11943 var instance = workInProgress.stateNode;
11944
11945 if (!instance) {
11946 throw new Error('Expected to have an instance by this point. ' + 'This error is likely caused by a bug in React. Please file an issue.');
11947 }
11948
11949 if (didChange) {
11950 // Merge parent and own context.
11951 // Skip this if we're not updating due to sCU.
11952 // This avoids unnecessarily recomputing memoized values.
11953 var mergedContext = processChildContext(workInProgress, type, previousContext);
11954 instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
11955 // It is important to unwind the context in the reverse order.
11956
11957 pop(didPerformWorkStackCursor, workInProgress);
11958 pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
11959
11960 push(contextStackCursor, mergedContext, workInProgress);
11961 push(didPerformWorkStackCursor, didChange, workInProgress);
11962 } else {
11963 pop(didPerformWorkStackCursor, workInProgress);
11964 push(didPerformWorkStackCursor, didChange, workInProgress);
11965 }
11966 }
11967 }
11968
11969 function findCurrentUnmaskedContext(fiber) {
11970 {

Callers 1

finishClassComponentFunction · 0.70

Calls 3

processChildContextFunction · 0.70
popFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…