04 / 05

How can you prevent the default behavior of an event in React?

You can use the preventDefault() method on the event object to prevent the default behaviour of an event, such as preventing a form from submitting or a link from navigating.

Usage: