Preventdefault Not Working React

[Solved] Preventdefault Not Working React | Typescript - Code Explorer | yomemimo.com
Question : preventdefault not working react

Answered by : johiny

//think if you are adding your submit handler function in the submit button
//or into the form itself
const handler = () => { e.preventDefault();
}
<form onSubmit={handler}> //good
<button type="submit" onSubmit={handler}> // bad 

Source : | Last Update : Fri, 22 Oct 21

Answers related to preventdefault not working react

Code Explorer Popular Question For Typescript