title: Using search in react js
body: <p>I want to filter content based on the input typed, I don't know where did I go wrong. Whenever I typed my input it just doesn't filter the content instead of that it is showing all the content there.</p>
  
  <pre><code>  function searchingFor(searchingTerm) {
          return function(x){
              console.log("searching",x);
              return x.name.toLowerCase().includes(searchingTerm.toLowerCase())|| searchingTerm;
          }
      }
  
      class Main extends React.Component{
  
          componentWillMount(){
              this.props.fetchTopicsTableContent(this.state.sortBy,'ASC',0,this.props.match.params.Occupation).then(result=&gt; (this.setState({rows:result.payload.data})))
              this.props.countTableContent(this.props.match.params.Occupation).then(result=&gt;(this.setState({count:result.payload})));
          }
  
          constructor(props){
              super(props);
  
              this.state={
                  searchTerm:"",
                  rows:""
              }
          }
  
      searchHandler(e){
              this.setState({searchTerm:e.target.value})
              // console.log("rows",this.state.rows)
              {this.state.rows.filter(searchingFor(this.state.searchTerm)).map(item=&gt;{
                  console.log(item);
                   // this.setState({rows:item})
              })}
          }
  
      render(){
          return(
              &lt;form&gt;
                 &lt;input type="text"
                    value={this.state.searchTerm}
                    onChange={this.searchHandler.bind(this)}
                  /&gt;
              &lt;/form&gt;);}}
  </code></pre>