Answers for "TypeError: Cannot read property 'preventDefault' of undefined"

-1

TypeError: Cannot read property 'preventDefault' of undefined

const submit=(e)=>{
	 e.preventDefault()
    console.log("press")
}

<Button  onClick={(event)=>submit(event)}>Click</Button>

//Pass the Event as parameter in on click function.
//Which is handle the form request.
Posted by: Guest on August-26-2020

Code answers related to "TypeError: Cannot read property 'preventDefault' of undefined"

Browse Popular Code Answers by Language