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

Function onSubmit

Video 119/src/App.jsx:23–36  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

21 }
22
23 const onSubmit = async (data) => {
24 // await delay(2) // simulating network delay
25 let r = await fetch("http://localhost:3000/", {method: "POST", headers: {
26 "Content-Type": "application/json",
27 }, body: JSON.stringify(data)})
28 let res = await r.text()
29 console.log(data, res)
30 // if(data.username !== "shubham"){
31 // setError("myform", {message: "Your form is not in good order because credentials are invalid"})
32 // }
33 // if(data.username === "rohan"){
34 // setError("blocked", {message: "Sorry this user is blocked"})
35 // }
36 }
37
38 return (
39 <>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected