()
| 1 | import React, { useState } from 'react'; |
| 2 | |
| 3 | function Exercise6() { |
| 4 | const [count, setCount] = useState(0); |
| 5 | |
| 6 | const handleClick = () => { |
| 7 | setCount(count + 1); |
| 8 | setTimeout(() => { |
| 9 | alert(count); |
| 10 | }, 3000); |
| 11 | }; |
| 12 | |
| 13 | return ( |
| 14 | <div> |
| 15 | <button onClick={handleClick}>Click Me</button> |
| 16 | <h1>{count}</h1> |
| 17 | </div> |
| 18 | ); |
| 19 | } |
| 20 | |
| 21 | export default Exercise6; |
nothing calls this directly
no outgoing calls
no test coverage detected