()
| 1 | import React, { useState, useEffect } from 'react'; |
| 2 | |
| 3 | function Exercise3() { |
| 4 | const [count, setCount] = useState(0); |
| 5 | |
| 6 | useEffect(() => { |
| 7 | const interval = setInterval(() => { |
| 8 | setCount(prevCount => prevCount + 1); |
| 9 | }, 1000); |
| 10 | |
| 11 | return () => clearInterval(interval); |
| 12 | }, []); |
| 13 | |
| 14 | return <h1>{count}</h1>; |
| 15 | } |
| 16 | |
| 17 | export default Exercise3; |
nothing calls this directly
no outgoing calls
no test coverage detected