Code is ginving suprising output in react. fucntion is not getting called after submit button

Solution 1:

You have to prevent the default behavior of a onSubmit handler for a form. Modify the beginning of your submit function as such:

handleSubmit(e) {
   e.preventDefault()
(...)

For a form submit handler, it prevents the form from been submitted.

Solution 2:

Regarding the refreshing issue. I believe this is the expected behavior of the form and the submit button, and all you need is to prevent the behavior.

Regarding the second issue, I believe it is a backend issue. try to disable Axios and check if you still have the same issue