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

Function findCurrentUnmaskedContext

code/third-party/public/app.js:11703–11718  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

11701 }
11702
11703 function findCurrentUnmaskedContext(fiber) {
11704 // Currently this is only used with renderSubtreeIntoContainer; not sure if it
11705 // makes sense elsewhere
11706 !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0;
11707
11708 var node = fiber;
11709 while (node.tag !== HostRoot) {
11710 if (isContextProvider(node)) {
11711 return node.stateNode.__reactInternalMemoizedMergedChildContext;
11712 }
11713 var parent = node['return'];
11714 !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
11715 node = parent;
11716 }
11717 return node.stateNode.context;
11718 }
11719
11720 return {
11721 getUnmaskedContext: getUnmaskedContext,

Callers 1

getContextForSubtreeFunction · 0.70

Calls 3

isFiberMountedFunction · 0.70
invariantFunction · 0.70
isContextProviderFunction · 0.70

Tested by

no test coverage detected