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

Function findCurrentUnmaskedContext

code/styling/public/app.js:12470–12485  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

12468 }
12469
12470 function findCurrentUnmaskedContext(fiber) {
12471 // Currently this is only used with renderSubtreeIntoContainer; not sure if it
12472 // makes sense elsewhere
12473 !(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;
12474
12475 var node = fiber;
12476 while (node.tag !== HostRoot) {
12477 if (isContextProvider(node)) {
12478 return node.stateNode.__reactInternalMemoizedMergedChildContext;
12479 }
12480 var parent = node['return'];
12481 !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
12482 node = parent;
12483 }
12484 return node.stateNode.context;
12485 }
12486
12487 return {
12488 getUnmaskedContext: getUnmaskedContext,

Callers 1

getContextForSubtreeFunction · 0.70

Calls 3

isFiberMountedFunction · 0.70
invariantFunction · 0.70
isContextProviderFunction · 0.70

Tested by

no test coverage detected