I have integrated React-Select (multi) with redux-form. It works if you select a value and submit. However if you need to submit the form again (ie. they had an invalid field) the React-Select(multi) has an array with undefined values.
<Field
ref={ref => this.refTest = ref}
className = "form-control"
name="categories"
options={
this.state.categories.map(c => {
return { value: c.id, label: c.categoryName };
})
}
onBlur={this.onBlur}
component={multiSelect}
/>
The multiSelect is using this component:
export const multiSelect = (field) => {
console.log(field);
return(
<div>
<Select
name={field.name}
{...field.input}
className="section"
multi={true}
options={field.options}>
</Select>
{field.meta.touched && field.meta.error &&
<label id="basic-error" className="validation-error-label">This field is required.</label>}
</div>
);
};
No matter what I do, the second "Submit" click always has an array with undefined for "category".