MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / findCurrentUnmaskedContext

Function findCurrentUnmaskedContext

code/composition/public/app.js:12608–12623  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

12606 }
12607
12608 function findCurrentUnmaskedContext(fiber) {
12609 // Currently this is only used with renderSubtreeIntoContainer; not sure if it
12610 // makes sense elsewhere
12611 !(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;
12612
12613 var node = fiber;
12614 while (node.tag !== HostRoot) {
12615 if (isContextProvider(node)) {
12616 return node.stateNode.__reactInternalMemoizedMergedChildContext;
12617 }
12618 var parent = node['return'];
12619 !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
12620 node = parent;
12621 }
12622 return node.stateNode.context;
12623 }
12624
12625 return {
12626 getUnmaskedContext: getUnmaskedContext,

Callers 1

getContextForSubtreeFunction · 0.70

Calls 3

isFiberMountedFunction · 0.70
invariantFunction · 0.70
isContextProviderFunction · 0.70

Tested by

no test coverage detected