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

Function App

packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.js:502–512  ·  view source on GitHub ↗
({label})

Source from the content-addressed store, hash-verified

500 const {useState, useEffect} = React;
501
502 function App({label}) {
503 const [step, setStep] = useState(0);
504 useEffect(() => {
505 if (step < 3) {
506 setStep(step + 1);
507 }
508 }, [step]);
509
510 // The component should keep re-rendering itself until `step` is 3.
511 return step === 3 ? 'Finished' : 'Unresolved';
512 }
513
514 const containerA = document.createElement('div');
515 const containerB = document.createElement('div');

Callers

nothing calls this directly

Calls 2

useStateFunction · 0.50
useEffectFunction · 0.50

Tested by

no test coverage detected