reactjs: need help to understand the below code
I came accross this code const [count, setCount] = useState(0); useEffect(() => { const timerId = setTimeout(() => setCount(count + 1), 1000); return () => setTimeout(timerId); }); I know useEffect syntax as useEffect(() => { something...which is executed }); but…