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