MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / App

Function App

Video 112/src/App.jsx:6–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import './App.css'
5
6function 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
41export default App

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected