MCPcopy Create free account
hub / github.com/coderarmy-notes/mern-stack-course / App

Function App

04React/Day09/src/App.jsx:4–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4function App() {
5
6 const [name,setName] = useState('');
7 const [age,setAge] = useState('');
8 const [password,setPassword] = useState('');
9
10 function handleSubmit(e){
11 e.preventDefault();
12 console.log(name);
13 console.log(age);
14 console.log(password);
15 }
16
17 console.log("Render");
18
19 return(
20 <>
21 <form onSubmit={handleSubmit}>
22 <div>
23 <input type='text' value={name} onChange={(e)=>setName(e.target.value)}></input>
24 </div>
25 <div>
26 <input type='number' value={age} min={10} max={80} onChange={(e)=>setAge(e.target.value)}></input>
27 </div>
28 <div>
29 <input type='password' value={password} onChange={(e)=>setPassword(e.target.value)}></input>
30 </div>
31 <button>Submit</button>
32 </form>
33 </>
34 )
35}
36
37export default App;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected