MCPcopy
hub / github.com/facebook/react / getMaskedContext

Function getMaskedContext

packages/react-server/src/ReactFizzLegacyContext.js:24–40  ·  view source on GitHub ↗
(type: any, unmaskedContext: Object)

Source from the content-addressed store, hash-verified

22}
23
24export function getMaskedContext(type: any, unmaskedContext: Object): Object {
25 if (disableLegacyContext) {
26 return emptyContextObject;
27 } else {
28 const contextTypes = type.contextTypes;
29 if (!contextTypes) {
30 return emptyContextObject;
31 }
32
33 const context: {[string]: $FlowFixMe} = {};
34 for (const key in contextTypes) {
35 context[key] = unmaskedContext[key];
36 }
37
38 return context;
39 }
40}
41
42export function processChildContext(
43 instance: any,

Callers 2

renderClassComponentFunction · 0.90
renderFunctionComponentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected