MCPcopy Create free account
hub / github.com/reactjs/react-rails / getContextForSubtree

Function getContextForSubtree

lib/assets/react-source/development/react.js:27949–27966  ·  view source on GitHub ↗
(parentComponent)

Source from the content-addressed store, hash-verified

27947 }
27948
27949 function getContextForSubtree(parentComponent) {
27950 if (!parentComponent) {
27951 return emptyContextObject;
27952 }
27953
27954 var fiber = get(parentComponent);
27955 var parentContext = findCurrentUnmaskedContext(fiber);
27956
27957 if (fiber.tag === ClassComponent) {
27958 var Component = fiber.type;
27959
27960 if (isContextProvider(Component)) {
27961 return processChildContext(fiber, Component, parentContext);
27962 }
27963 }
27964
27965 return parentContext;
27966 }
27967
27968 function findHostInstanceWithWarning(component, methodName) {
27969 {

Callers 1

updateContainerFunction · 0.85

Calls 4

getFunction · 0.85
processChildContextFunction · 0.85
isContextProviderFunction · 0.70

Tested by

no test coverage detected