title: React. How to update the state with previous state?
body: <p>I'm trying to update the state, based on previous state <code>(array of objects)</code> with the new incoming values in fase of <code>object</code>. But for some reasons it does not happen...</p>
  
  <p>What is I'm doing wrong? My code:</p>
  
  <pre><code>   handleCommentSubmit = (newEmployer) =&gt; {
         console.log('handleCommentSubmit BEFORE', this.state.employers, newEmployer); // array(5)
         this.setState((prevState, newEmployer) =&gt; { 
           employers: prevState.employers + newEmployer
         });
         console.log('handleCommentSubmit AFTER', this.state.employers); // still array(5)
     }
  </code></pre>
  
  <p>My log:</p>
  
  <pre><code>handleCommentSubmit BEFORE (6) [{…}, {…}, {…}, {…}, {…}, {…}], newEmployer: {first_name: "sdfsdf", last_name: "sdfsdf", birth_date: "123123-03-12", salary: "123123123"}
  handleCommentSubmit AFTER (6) [{…}, {…}, {…}, {…}, {…}, {…}]
  </code></pre>