#4797·redux-form

Feature: pass field's `syncError`/`asyncError`/`submitError` in injected `meta`

Author: jedwards1211Created Jun 11, 2025Updated Jun 11, 2025
Labelsfeature

Subject of the feature

createFieldProps injects error: syncError || asyncError || submitError and then field components typically show this error if the field is touched. This is usually desired, but not always...

I would like for createFieldProps to inject syncError, asyncError, and submitError into the meta prop for my connected field component, so I can customize this logic.

Problem

I have a OTP code field. When submission fails because the code is invalid, I want to clear the field and show a "code is invalid, please try again" error on the field until the user touches it again.

Right now, if the field is blank, the syncError: 'is required' stomps on the submitError: 'code is invalid'.

Expected behavior

I use onSubmitFail to setValue(name, ''); untouch(name). Then I just have to make my field component display error: meta.touched ? meta.error : <field submit error>. Getting <field submit error> is less convenient than it should be.

Alternatives

Right now I have to getFormSubmitErrors and then getIn(submitErrors, name) to get the field's submit error. It's a shame I have to bend over backward to do this when ConnectedField already extracted this from the form state. If only it would pass the value along!