title: React filter method without mutating state
body: <p>My current state has this:</p>
  
  <pre><code>state = { items : [{id: 1, text: 'test words'}, {id: 2, text: 'another test'}]
  </code></pre>
  
  <p>Here's my function to remove objects from the array, trying to avoid mutating state.</p>
  
  <pre><code>handleRemove(passedInId) {
  
    const myItems = this.state.items
  
    const newArray = myItems.filter(item =&gt; item.id !== passedInId)
  
    this.setState(prevState =&gt; ({
      items: prevState.items = newArray
    }))
  
    console.log('handle remove runned', passedInId, myItems, newArray)
  
  }
  </code></pre>
  
  <p>It works perfectly but would like to know if it's not anti-pattern before moving on with my life  </p>
  
  <p>Many THANKS!!</p>