These are chat archives for erikras/redux-form

Apr 2017
Anh Le (Andy)
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

Is it OK?

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