Events

React event preventDefault()

Cancel a cancelable browser default action without automatically stopping propagation.

Formal Syntax & Structure

react syntaxreact
event.preventDefault()

Working Example

Example Snippetreact
function Form() { return <form onSubmit={e=>e.preventDefault()}><button type="submit">Try</button></form>; }
React Reference