MCPcopy Create free account
hub / github.com/coderarmy-notes/mern-stack-course / Clock

Function Clock

04React/Day06/vite-project/src/Clock.jsx:4–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import Counting from "./Counting";
3
4function Clock(){
5
6 const [clocks,setClocks] = useState(["A","B","C"]);
7
8 function handlChange(){
9 setClocks(["D",...clocks]);
10 }
11
12 return (
13 <>
14 <button onClick={handlChange}>Increment Clocks</button>
15 <div style={{display:"flex", justifyContent:"center", alignItems:"center", gap:"20px", flexWrap:"wrap"}}>
16 {clocks.map(clock => <Counting key={clock} name={clock}></Counting> )}
17 </div>
18 </>
19 )
20}
21
22export default Clock;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected