In the documentation I can see how to initialize the form state, as in the initial values. However, I can't find anything on how to initialize certain fields in their error state.
My use case is that I'm loading the form to edit with initial values, but some values might be wrong. For example, a date field might need to be updated, because the date has passed. So, I need to show the field in error after the form loads, and before the user touches it.
I should also note that I am not using the reducer.plugin because that plugin requires you to define the form identifier. I want my component to be usable in general, so I don't want to tie it down with a pre-defined identifier. I basically need exactly what initalValues
does for the values, but like initalErrors
or something.
How do I accomplish this?
You may be able to hijack the
handleSubmit
function of Redux-Form with something like the following: