title: React setState() not update the state
body: <p>State</p>
  <pre><code>state = {
      likedPosts: [{movie: '5b21ca3eeb7f6fbccd471816', down: true}],
    };
  </code></pre>
  <p>function</p>
  <pre><code>  handleLike(movieId) {
      if (this.state.likedPosts.filter((e) =&gt; e.movie === movieId).length &gt; 0) {
        const likedPosts = this.state.likedPosts.filter(function (l) {
          if (l.movie !== movieId) {
            return l;
          }
        });
        console.log(likedPosts); // this returns the expected object
        this.setState({ likedPosts }); // this not work
      } else {
        this.state.likedPosts.push({ movie: movieId, down: true }); // this works
      }
      console.log(&quot;now&quot;, this.state.likedPosts);
    }
  </code></pre>
  <p>I want push new object if object not in <code>this.state.likedPosts</code> array or remove the object if that object in array.</p>
  <p>When object exist in <code>this.state.likedPosts</code>, <code>console.log(likedPosts)</code> returns the expected new array. But <code>this.setState({ likedPosts })</code> does not update the state. What is the problem in here?</p>