title: Update array of object in React Js
body: <p>I want to update question name on <code>onChange</code> event. But problem is every question changes if I change only one ques.How to fix it ?</p>
  
  <pre><code>class QuestionCreate extends React.Component {
      constructor(props){
          super(props);
          this.state = {
              datas: [],
              default_question: {
                  isNew: true,
                  question: {
                      name: 'Click to write the question text',
                      answer_options: [
                          {name: 'click to write choice 1', 'choice': true},
                          {name: 'click to write choice 1', 'choice': true},
                          {name: 'click to write choice 1', 'choice': true},
                      ]
                  }
              }
          }
  
      }
  
  
      onChangeQuestion(qustions, index, event){
          let all_data = this.state.datas;
          let currentQuestion = all_data[index].question
          all_data[index]['question']['name'] = event.target.value;
          console.log(all_data[index]['question']['name'])
          this.setState({datas: all_data})
  
      }
  
      displayRow(){
      let rowData = this.state.datas.map( (data, index) =&gt;{
          console.log("this is data:", data, index);
          return(
              &lt;div className="well" key={ index }&gt;
                  &lt;h3&gt;Q. &lt;input type="text" onChange={ this.onChangeQuestion.bind(this, data, index) } value={ data.question.name } /&gt;&lt;/h3&gt;
                      &lt;ul&gt;
                          &lt;li&gt;option&lt;/li&gt;
                      &lt;/ul&gt;
              &lt;/div&gt;
          )
      })
  
      return rowData;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6AcwU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6AcwU.png" alt="enter image description here"></a></p>