title: ReactJS "Unhandled Rejection (TypeError): this.state.features.map is not a function"
body: <p>I'm learning React and now I'm trying to do a get request and list with map but when I run this code they come up with this error &quot;Unhandled Rejection (TypeError): this.state.features.map is not a function&quot;. I have already searched this but I do not understand what is going on.</p>
  <pre><code>   import React, { Component } from 'react';
  import './App.css';
  
  class App extends Component {
  
    constructor() {
      super();
      this.state = {
        features: [{
          id: 1,
          name: 'Test',
          count: 1
        }]
      }
    }
  
    componentWillMount() {
      fetch(&quot;http://demo6085176.mockable.io/features&quot;)
        .then(response =&gt; response.json())
        .then(json =&gt; {
          console.log(json);
          this.setState({
            features: json,
          });
        });
      console.log(this.state.features)
        
    }
  
    render() {
      return (
        &lt;div className=&quot;App&quot;&gt;
          &lt;ul&gt;
            {
              this.state.features.map(function(feature){
                return (
                  &lt;li key={feature.id}&gt;&lt;button type=&quot;button&quot;&gt;Upvote&lt;/button&gt; ({feature.count}) &lt;span&gt;{feature.name}&lt;/span&gt;&lt;/li&gt;
                )
              })
            }
          &lt;/ul&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>