redux-form: Field validations not working when using an array v7.0.0

multiplevalidationerror2

I’m having a weird first time error with redux form causing validations inside an array not to work.

Using "redux-form": "^7.0.0",

Edit Using v6.8.0 still works.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 12
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Fix published in v7.0.1.

Yes. Everyone using field-level validation should stick with v6.8.0 for now. Apologies… 😳

@erikras I just test-bumped to 7.0.1 from 6.8.0 and I am still seeing some variation on this error. I’m using an array of validation functions, e.g:

            <Input
              name={'path'}
              formName={FORM_NAME}
              validate={[
                validate('no-empty'),
                validate('no-spaces'),
                validate('no-number-sign'),
                validate('no-backward-slashes'),
                validate('no-question-mark'),
                validate('no-period'),
                validate('no-ampersand'),
                validate('no-dollar-sign'),
                validate('no-equals-sign'),
                validate('first-char-must-be-a-forward-slash'),
                validate('no-repeating-forward-slash'),
              ]}
            />

In 7.0.1, when I test-type anything in one of the validated inputs, I get a spew of 6 or 8 sudden pairs of REGISTER_FIELD and UNREGISTER_FIELD actions, called in succession. It’s not an infinite loop, as @Bonitis describes above. But it’s multiple cycles. In 6.8.0 when I type there are just CHANGE actions dispatched, as expected.

Validation UI that was working before is now broken. The ConnectedField HOC doesn’t receive the syncError string when I type invalid input. Can you please circle back on this? (Sorry I don’t have a reduced test case at the moment.) Thank you!

You should win some sort of prize for the first bug report after a major version. 😁 🎁

Any chance you could represent it in a sandbox?

Same issue here. I am also getting a 'Unhandled Rejection (RangeError): Maximum call stack size exceeded ’ error when I put the validation in an array.

@Bonitis, your validation funtion is defined outside of the component which is render redux-form Field/FieldArray?