There are two ways to handle validation in redux-form. In this example, we are going to find out how to use field-level-validation using reusable functions, which presents a clean, readable syntax attached to each redux-form Field
element.
How would you go about including the name of the field in the error message in this version?
How would you go about including the name of the field in the error message in this version?
Hi Stefan, to achieve that I would probably use the validation function approach.
@Stefan The validation function provides you that as a 4th argument. See https://redux-form.com/7.4.2/docs/api/field.md/#-code-validate-value-allvalues-props-name-gt-error-code-optional-
@Rory In this episode example it's not explicit how you avoid getting 'property length of undefined' on validation. Maybe you should also mention that.