MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / Aaa

Function Aaa

hook-test/src/App6.tsx:3–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { memo, useEffect, useState } from "react";
2
3function Aaa() {
4 const [,setNum] = useState(1);
5
6 const [count, setCount] = useState(2);
7
8
9 useEffect(() => {
10 setInterval(()=> {
11 setNum(Math.random());
12 }, 2000)
13 },[]);
14
15 useEffect(() => {
16 setTimeout(()=> {
17 setCount(Math.random());
18 }, 2000)
19 },[]);
20
21 return <div>
22 <MemoBbb count={count}></MemoBbb>
23 </div>
24}
25
26interface BbbProps {
27 count: number;

Callers

nothing calls this directly

Calls 2

useStateFunction · 0.90
useEffectFunction · 0.90

Tested by

no test coverage detected