title: How to update an object in an array of Objects using setState
body: <p>I am using React, my state is defined as an array of object.
  I need to be able to change only one specific element in the state.data array, example object with id 1.</p>
  
  <p>I would like to know:</p>
  
  <ul>
  <li>what is the proper way how to use <code>setState()</code> in this scenario.</li>
  </ul>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>constructor(props) {
    super(props);
    this.state = {
      data: [{
          id: 0,
          title: 'Buy a',
          status: 0, // 0 = todo, 1 = done
        },
        {
          id: 1,
          title: 'Buy b',
          status: 0,
        },
        {
          id: 2,
          title: 'Buy c',
          status: 0,
        }
      ]
    };
    this.onTitleChange = this.onTitleChange.bind(this);
  }
  onTitleChange(id, title) {
    console.log(id, title);
    debugger
  }</code></pre>
  </div>
  </div>
  </p>