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

Function App

packages/react/src/__tests__/ReactStrictMode-test.js:212–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210 const log = [];
211
212 function App() {
213 React.useState(() => {
214 log.push('Compute initial state count: 1');
215 return 1;
216 });
217 React.useReducer(
218 s => s,
219 2,
220 s => {
221 log.push('Compute initial reducer count: 2');
222 return s;
223 },
224 );
225
226 return 3;
227 }
228
229 const container = document.createElement('div');
230 const root = ReactDOMClient.createRoot(container);

Callers

nothing calls this directly

Calls 3

pushMethod · 0.65
useStateFunction · 0.50
useReducerFunction · 0.50

Tested by

no test coverage detected