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

Function Component

packages/react-dom/src/__tests__/ReactDOMRoot-test.js:291–301  ·  view source on GitHub ↗
({text})

Source from the content-addressed store, hash-verified

289
290 it('should unmount and remount if the key changes', async () => {
291 function Component({text}) {
292 useEffect(() => {
293 Scheduler.log('Mount');
294
295 return () => {
296 Scheduler.log('Unmount');
297 };
298 }, []);
299
300 return <span>{text}</span>;
301 }
302
303 const root = ReactDOMClient.createRoot(container);
304

Callers

nothing calls this directly

Calls 1

useEffectFunction · 0.50

Tested by

no test coverage detected