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

Function readContext

packages/react-reconciler/src/__tests__/ReactMemo-test.js:104–110  ·  view source on GitHub ↗
(Context)

Source from the content-addressed store, hash-verified

102 const CountContext = React.createContext(0);
103
104 function readContext(Context) {
105 const dispatcher =
106 React
107 .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
108 .H;
109 return dispatcher.readContext(Context);
110 }
111
112 function Counter(props) {
113 const count = readContext(CountContext);

Callers 1

CounterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected