insin / insin/newforms

Field choices still raises React warning

Open
#82 1 comment 0 reactions 0 assignees View on GitHub
Defect
Dominant language
JavaScript
Stars
634
Forks
46
PR merge metrics
No merged PRs in 30d

Description

This sample gives "Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of FormRow."

This was fixed in #68, but somehow still gives warnings.

``` javascript
var React = require("react");
var forms = require("newforms");

var IPIN = forms.Form.extend({
dev: forms.ChoiceField(),
});

var Thing = React.createClass({
getInitialState: function(){
return {form: new IPIN({controlled:true, onChange: this.forceUpdate.bind(this)})}
},

componentDidMount: function(){
var fform = this.refs["ipin"].getForm();
fform.fields.dev.setChoices(["a", "b", "c"]);
fform.setData({}); //to force re-render
},

render: function(){
return (


submit

);
}
});
var r = React.render(, document.body);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.