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

Function handleStart

04React/Day08/src/App.jsx:11–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 const intrervalIdRef = useRef(null);
10
11 function handleStart(){
12
13 if(intrervalIdRef.current!=null){
14 return;
15 }
16
17 intrervalIdRef.current = setInterval(()=>{
18 setTime(time=>time+1);
19 },1000);
20 }
21
22 function handleStop(){
23 clearInterval(intrervalIdRef.current);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected