title: React class method not defined no-undef
body: <p>I'm new to react and I'm trying to pull and display data from randomuserapi. I've made the api call but when I run my app, I get the error below:</p>
  
  <pre><code>./src/App.js
  Line 45:  'getData' is not defined  no-undef
  </code></pre>
  
  <p>Here's my code below: The getData() method is where I make the api call. That method is now called in ComponentDidMount. </p>
  
  <p>I also binded getData() to my constructor but I still get the error above.</p>
  
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  
  class App extends Component {
    constructor(props) {
      super(props);
      this.state = {
        people: []
   }
  
   this.getData = this.getData.bind(this);
  }
  
  getData() {
   const promise = fetch('https://randomuser.me/api/?results=20')
     .then(response =&gt; {
       if (response.status &gt;= 400) {
       throw `Response Invalid ( ${response.status} )`;
       return;
     }
     return response.json();
   })
   .then(({results}) =&gt; {
     return results;
   })
   .catch(error =&gt; {
     console.log(error);
   });
  
   return promise;
  }
  
  ComponenDidMount() {
    getData()
      .then(data =&gt; {
        this.setState({
          people: data
        });
      });
  }
  
  render() {
    return (
      &lt;div&gt;
        &lt;p&gt;{this.state.people.results[0].gender}&lt;/p&gt;
      &lt;/div&gt;
    );
   }
  }
  
  export default App;
  </code></pre>
  
  <p>I'm also using create-react-app from Github. Please some assistance will be helpful.</p>
  
  <p>Thanks!</p>