Use the preventDefault() method on the event object to prevent a page refresh on form submit in React, e.g. event. preventDefault() . The preventDefault method prevents the browser from issuing the default action which in the case of a form submission is to refresh the page.
How do I stop a page from refreshing in HTML?
Window stop() The stop() method stops window loading. The stop() method is the same as clicking stop in the browser.
How do I stop a page from submitting?
The simplest solution to prevent the form submission is to return false on submit event handler defined using the onsubmit property in the HTML