MCPcopy Create free account
hub / github.com/react/react / Counter

Function Counter

packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js:229–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227
228 let setCounter;
229 function Counter() {
230 const [counter, _setCounter] = useState(0);
231 setCounter = _setCounter;
232
233 Scheduler.log(`Count: ${counter}`);
234 return counter;
235 }
236
237 const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
238 root.update(<Counter />);

Callers

nothing calls this directly

Calls 4

useStateFunction · 0.50
useReducerFunction · 0.50
useEffectFunction · 0.50
incrementFunction · 0.50

Tested by

no test coverage detected