Menu
  • HOME
  • TAGS

react newforms, throw error on server response

javascript,reactjs,newforms

You can use form.addError() for this: form.addError('username', 'Username does not exist.') If there isn't another state change happening associated with the server response, you may need to force your component to re-render. It also supports async validation, so it's possible to do the server call inside a custom validation method...