title: Why the pop() or push() method of an array in the state of react can work
body: <pre><code>const { items } = this.state;
  this.setState({ 
    items: this.state.items.slice(0, this.state.items.length - 1)
  });
  </code></pre>
  
  <p>I know the code above can work well in react</p>
  
  <p>However,</p>
  
  <pre><code>const { items } = this.state;
  items.pop();
  this.setState({ items });
  </code></pre>
  
  <p>I just don't know why this can still update the <code>dom</code> if there is a list rendered by the <code>this.state.items</code> (like <code>&lt;div className="list"&gt;{this.state.items}&lt;/div&gt;</code>). </p>
  
  <p>I am confused that the <code>items.pop()</code> have changed the origin state, isn't the next state's items equal the origin state's items.Why this can still update the <code>dom</code> .</p>