title: I'm getting an error "TypeError: searchField.toLowerCase is not a function"
body: <p>**    I'm getting an error  &quot;TypeError: searchField.toLowerCase is not a function&quot; when trying to run this code whereas the code is compiling successfully**</p>
  <pre><code>import React, { Component } from 'react';
  import CardList from '../Components/CardList';
  import SearchBox from '../Components/SearchBox';
  //import { robots } from './robot';
  import './App.css';
  import Scroll from '../Components/Scroll';
  import ErrorBoundry from '../Components/ErrorBoundry';
  import { connect } from 'react-redux';
  import { searchChange } from '../actions'     
   
   
   
   const mapStateToProps = state =&gt; {
      return {searchField:state.searchField}
   }
   
   const mapDispatchToProps = (dispatch) =&gt;{
      return {
          searchField:(event) =&gt; dispatch(searchChange(event.target.value))
      }
   }
   
   class App extends Component {
      constructor(){
          super()
          this.state = {
              robots:[]
          }   
      }
      
   
   
      componentDidMount() {
          fetch('https://jsonplaceholder.typicode.com/users').then(respond =&gt;{
              return respond.json()
          }).then(users =&gt;{
   
              this.setState({robots:users})
          })
      }
      
      render(){
          const { searchField, onSearchChange } = this.props;
          const filterRobots = this.state.robots.filter(robots =&gt;{
              //trying to search robot with either upper case or lower case
              return robots.name.toLowerCase().includes(searchField.toLowerCase())
          });
   
          return(
              &lt;div className=&quot;tc&quot;&gt;
              &lt;h1 className=&quot;head&quot;&gt; Robo Friend App&lt;/h1&gt;
              &lt;div&gt;
              &lt;SearchBox searchChange={onSearchChange}/&gt;
              &lt;/div&gt;
   
              &lt;Scroll&gt;
              &lt;ErrorBoundry&gt;
              &lt;CardList robots={filterRobots} /&gt;
              &lt;/ErrorBoundry&gt;
              &lt;/Scroll&gt;
              &lt;/div&gt;
              )
      }
      
   }
   
   export default connect(mapStateToProps, mapDispatchToProps)(App);
  </code></pre>