Warning: Each child in an array or iterator should have a unique "key" prop.
Seems to be an issue with using checkboxes.
let Search = forms.Form.extend({
customer: forms.CharField({required: false}),
location: forms.CharField({required: false}),
payment_method: forms.MultipleChoiceField({
widget: forms.CheckboxSelectMultiple(),
choices: [['offline', 'Offline'], ['online', 'Online']],
required: false
})
});
class SearchForm extends React.Component {
searchSubmit(e) {
e.preventDefault();
debugger;
}
render() {
return (
<div>
<h2>Search Filter</h2>
<form ref="formWrapper" onSubmit={this.searchSubmit} >
<forms.RenderForm form={Search} ref="form">
<Container>
<Row>
<Field name="customer" label="Customer name" md="3" />
<Field name="location" label="Store ID / Store name" md="3" />
<Field name="payment_method" label="Payment method" md="3" />
</Row>
</Container>
</forms.RenderForm>
<button ref="submit" type="submit" >Filter Results</button>
</form>
</div>
);
}
}
If I change to using the default SelectMultiple widget, the warning goes away.
Warning also appears if you use a RadioSelect()
@insin Is there a roadmap to fix?
@insin +1, wonderful library, a pain to learn, but worth it in the end if this bug is gone... React requires a unique key property for all fields in a form.
Warning also appears with simple Form, such as: var LoginForm = Forms.Form.extend({ coban: Forms.IntegerField(), operador: Forms.IntegerField(), password: Forms.CharField({widget: Forms.PasswordInput}) });
newforms 0.13.2