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

Function findCurrentUnmaskedContext

code/communication/public/app.js:12505–12520  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

12503 }
12504
12505 function findCurrentUnmaskedContext(fiber) {
12506 // Currently this is only used with renderSubtreeIntoContainer; not sure if it
12507 // makes sense elsewhere
12508 !(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;
12509
12510 var node = fiber;
12511 while (node.tag !== HostRoot) {
12512 if (isContextProvider(node)) {
12513 return node.stateNode.__reactInternalMemoizedMergedChildContext;
12514 }
12515 var parent = node['return'];
12516 !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
12517 node = parent;
12518 }
12519 return node.stateNode.context;
12520 }
12521
12522 return {
12523 getUnmaskedContext: getUnmaskedContext,

Callers 1

getContextForSubtreeFunction · 0.70

Calls 3

isFiberMountedFunction · 0.70
invariantFunction · 0.70
isContextProviderFunction · 0.70

Tested by

no test coverage detected