Typeerror Cannot Read Property Preventdefault Of Undefined

[Solved] Typeerror Cannot Read Property Preventdefault Of Undefined | Typescript - Code Explorer | yomemimo.com
Question : TypeError: Cannot read property 'preventDefault' of undefined

Answered by : mukesh

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.

Source : | Last Update : Wed, 02 Sep 20

Answers related to typeerror cannot read property preventdefault of undefined

Code Explorer Popular Question For Typescript