title: TypeError: this.state.robots.filter is not a function?
body: <p>Trying to fetch the Jsonplaceholder users name and id and filter them in in the render method. I'm getting this error:</p>
  
  <pre><code>TypeError: this.state.robots.filter is not a function
  </code></pre>
  
  <pre><code>class App extends React.Component {
    constructor() {
      super()
      this.state = {
        robots: [],
        searchfield: ''
      }
    }
  
    componentDidMount() {
      fetch('https://jsonplaceholder.typicode.com/users')
      .then(response =&gt; {
        return response.json;
      })
      .then((users) =&gt; {
        this.setState({robots: users});
      })
    }
  
    onSearchChange = (event) =&gt; {
      this.setState({searchfield: event.target.value});
    }
  
    render() {
      const filteredRobots = this.state.robots.filter(robot =&gt; {
        return robot.name.toLowerCase().includes(this.state.searchfield.toLowerCase());
      })
    return (
      &lt;div className="container text-center mt-4"&gt;
          &lt;h1 className="custom mb-5"&gt;RoboFriends&lt;/h1&gt;
          &lt;SearchBox searchChange={this.onSearchChange} /&gt;
          &lt;CardList robots={filteredRobots} /&gt;
      &lt;/div&gt;
    );
  }
  }
  </code></pre>
  
  <p>Could anyone give me a clue how to solve the problem? Thank you in advance!</p>