title: React filter best practices
body: <p>How to not lose React state in this case when I do filter? </p>
  
  <p>When I do filter I lose my previous state and program work not correct, for example, if I choose category sport, then try category fashion, I can't see anything in fashion, the case this all was dropped, when I choose sport.</p>
  
  <p>I am new in React I would like to hear the best practices.</p>
  
  <pre><code>    FilterCategory(e) {
      // Filter
      const filter = this.state.items.filter(
        (item) =&gt; {
          return item.category.indexOf(e.target.name) !== -1
        }
      )
      // Update state
      this.setState({
        items:filter
      })
    }
  </code></pre>