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

Function useContext

packages/react-reconciler/src/ReactFiberHooks.js:4022–4026  ·  view source on GitHub ↗
(context: ReactContext<T>)

Source from the content-addressed store, hash-verified

4020 return mountCallback(callback, deps);
4021 },
4022 useContext<T>(context: ReactContext<T>): T {
4023 currentHookNameInDev = 'useContext';
4024 mountHookTypesDev();
4025 return readContext(context);
4026 },
4027 useEffect(
4028 create: () => (() => void) | void,
4029 deps: Array<mixed> | void | null,

Callers 15

renderMethod · 0.50
FooFunction · 0.50
ConsumerFunction · 0.50
AsyncFunction · 0.50
DeepChildFunction · 0.50
DeepChild1Function · 0.50
DeepChild2Function · 0.50
ChildFunction · 0.50
ParentFunction · 0.50

Calls 1

readContextFunction · 0.90

Tested by 11

renderMethod · 0.40
FooFunction · 0.40
ConsumerFunction · 0.40
AsyncFunction · 0.40
DeepChildFunction · 0.40
DeepChild1Function · 0.40
DeepChild2Function · 0.40
ChildFunction · 0.40
ParentFunction · 0.40
MemoizedChildFunction · 0.40
PageFunction · 0.40