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

Function requiredContext

packages/react-reconciler/src/ReactFiberHostContext.js:36–46  ·  view source on GitHub ↗
(c: Value | null)

Source from the content-addressed store, hash-verified

34 createCursor(null);
35
36function requiredContext<Value>(c: Value | null): Value {
37 if (__DEV__) {
38 if (c === null) {
39 console.error(
40 'Expected host context to exist. This error is likely caused by a bug ' +
41 'in React. Please file an issue.',
42 );
43 }
44 }
45 return (c: any);
46}
47
48function getCurrentRootHostContainer(): null | Container {
49 return rootInstanceStackCursor.current;

Callers 3

getRootHostContainerFunction · 0.85
getHostContextFunction · 0.85
pushHostContextFunction · 0.85

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected