These are chat archives for erikras/redux-form

20th
Apr 2017
Anh Le
@anhldbk
Apr 20 2017 00:12

Hi guys,

Would you please tell me how to properly handle Submit validations when my validations are Promises.

I've read the comment on issue 256:

<form onSubmit={event =>
  handleSubmit(mySubmitAction)(event) // <---- this is the promise returned from handleSubmit()
    .then(() => {
        // submission was successful
      }, errors => {
        // submission was unsuccessful
      }))}>
  // render inputs
</form>

Is it OK?

Anh Le
@anhldbk
Apr 20 2017 00:26
I've also tried the example. I always get the following error (may be my implementation is buggy)
Imgur
Daniƫl Terwiel
@Egidius
Apr 20 2017 05:41
@anhldbk return the Promise
Anh Le
@anhldbk
Apr 20 2017 07:42
@Egidius so we have to catch Promise errors and update internal state accordingly?