()
| 4 | import './App.css' |
| 5 | |
| 6 | function App() { |
| 7 | const [count, setCount] = useState(0) |
| 8 | // const [name, setName] = useState("Harry") |
| 9 | const [form, setForm] = useState({}) |
| 10 | |
| 11 | const handleClick = () => { |
| 12 | alert("Hey I am clicked") |
| 13 | } |
| 14 | |
| 15 | const handleMouseOver = () => { |
| 16 | alert("Hey I am a mouse over") |
| 17 | } |
| 18 | |
| 19 | const handleChange = (e) => { |
| 20 | // setName(e.target.value) |
| 21 | setForm({...form, [e.target.name]:e.target.value}) |
| 22 | console.log(form) |
| 23 | } |
| 24 | |
| 25 | return ( |
| 26 | <> |
| 27 | <div className="button"> |
| 28 | <button onClick={handleClick}>Click me</button> |
| 29 | </div> |
| 30 | |
| 31 | {/* <div className="red" onMouseOver={handleMouseOver}> |
| 32 | I am a red div |
| 33 | </div> */} |
| 34 | |
| 35 | <input type="text" name='email' value={form.email?form.email:"" } onChange={handleChange} /> |
| 36 | <input type="text" name='phone' value={form.phone?form.phone:"" } onChange={handleChange} /> |
| 37 | </> |
| 38 | ) |
| 39 | } |
| 40 | |
| 41 | export default App |
nothing calls this directly
no outgoing calls
no test coverage detected