I'm wondering how to get async validation to trigger on a Field component inside of a FieldArray. I have something like:
class MyForm extends Component {
constructor(props) {
super(props)
}
render() {
const { handleSubmit } = this.props
return (
<form onSubmit={handleSubmit}>
<Field
name="name"
type="text"
component={RenderInputField}
/>
<FieldArray
name="hobbies"
component={RenderHobbies}
/>
</form>
)
}
}
MyFormBase = reduxForm ({
form: 'MyForm',
validate,
asyncValidate,
asyncBlurFields: ['name', 'hobbies.hobby']
})(MyFormBase)
With RenderHobbies as:
const RenderHobbies = ({fields}) => (
<div>
{fields.map((hobby, index) => ({
<Field
name={`${hobby}.hobby`}
component={RenderInputField}
/>
}))}
</div>
)
export default RenderHobbies
This doesn't work. async validation will fire for "name" on blur but not "hobbies.hobby". What would the correct syntax for that be?