React · Junior · Question 19 of 75

How do you cancel the default form submission behavior in React?

Explanation

In React, handlers receive a synthetic event with the same API as the native one. return false, as in old inline HTML handlers, doesn't work here. You can stop bubbling with e.stopPropagation().

Further reading

Problem with a question

React · Junior · question 19

Test yourself

Take the React · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz