Passing data as props in form function

Hi fam how can I pass props on a form function below is my form function

const handlesubmit =(e:React.FormEvent ) =>{
e.preventDefault()
axios.post('/api/register', data)
.then(()=>{
router.push('/')
}
.catch((error) =>{
toast.error('invalid')
}
}

How can I pass data as prop
Was this page helpful?