Use Async/Await in event handler in react

Your async is declared on the wrong function: it should be the inner function that is being returned, since it is the one that contains the await keyword:

const handleSubmit = (form_username, form_email, form_password) => async (event) => {
  // Rest of the logic here

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top