How to pass dynamic input field value to state as an array and update the value when user changes the input again?
Input field was generated by JSON data and in the state, we cannot define the initial value for all. Can anyone give some advice for this kind of problem?
this.state = {
file:[{value1,value2}]
};
and input field is generated like
{this.state.language.map((item,index) =>
<div className="be-checkbox inline" key={index} >
<input type="text" onChange={this.handleChange.bind(this, index)} value={this.state.index} />
</div>
)}