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

Function getUnmaskedContext

code/controlled-uncontrolled/public/app.js:11620–11630  ·  view source on GitHub ↗
(workInProgress)

Source from the content-addressed store, hash-verified

11618 var previousContext = emptyObject;
11619
11620 function getUnmaskedContext(workInProgress) {
11621 var hasOwnContext = isContextProvider(workInProgress);
11622 if (hasOwnContext) {
11623 // If the fiber is a context provider itself, when we read its context
11624 // we have already pushed its own child context on the stack. A context
11625 // provider should not "see" its own child context. Therefore we read the
11626 // previous (parent) context instead for a context provider.
11627 return previousContext;
11628 }
11629 return contextStackCursor.current;
11630 }
11631
11632 function cacheContext(workInProgress, unmaskedContext, maskedContext) {
11633 var instance = workInProgress.stateNode;

Callers 6

constructClassInstanceFunction · 0.70
mountClassInstanceFunction · 0.70
resumeMountClassInstanceFunction · 0.70
updateClassInstanceFunction · 0.70

Calls 1

isContextProviderFunction · 0.70

Tested by

no test coverage detected