<input>
.let Form = React.createClass({
getInitialState() {
return {
fieldsCount: 1
};
},
_addField() {
this.setState({ fieldsCount: this.state.fieldsCount + 1 });
},
render() {
let fields = [];
for (let i = 0; i < this.state.fieldsCount; i++) {
fields.push(<input />);
}
return (
<form>
{fields}
<button onClick={this._addField}>+</button>
</form>
);
}
});