title: ReactJS TypeError: undefined is not a function (near '...this.state.data.map...')
body: <p>I am new at React and trying to learn it. I am getting data from API and I will use the data. It returns money rates based on 'USD'. I am gonna use that data for convert money but I am getting this error: <a href="http://www.imgim.com/screenshot2018-03-02at165606.png" rel="nofollow noreferrer">Error here</a></p>
  <p><a href="https://i.stack.imgur.com/Cwe5e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cwe5e.png" alt="screenshot" /></a></p>
  <p>I don't know what the problem is.</p>
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  
  
  class App extends Component {
  
      constructor (props) {
          super(props)
          this.state = {data: 'false'};
      }
  
      componentDidMount(){
          this.getData();
      }
  
      getData = () =&gt; {
          fetch(&quot;https://openexchangerates.org/api/latest.json?app_id=88a3d2b24b174bf5bec485533a3bca88&quot;)
              .then(response =&gt; {
                  if (response.ok) {
                      return response;
                  } else {
                      let errorMessage =
                          '${response.status(${response.statusText})',
                    error = new Error(errorMessage);
                    throw(error);
                   }
                  })
                  .then(response =&gt; response.json())
                  .then(json =&gt;{
                     console.log(json);
                     this.setState({ data: json.data })
                  });
       
      }
  
    render() {
  
  
  
      return (
        &lt;div className=&quot;App&quot;&gt;
          &lt;header className=&quot;App-header&quot;&gt;
            &lt;h1 className=&quot;App-title&quot;&gt;React App&lt;/h1&gt;
          &lt;/header&gt;
  
            {
                this.state.data &amp;&amp;
                this.state.data.map( (item, key) =&gt;
                    &lt;div key={key}&gt;
                        {item}
                    &lt;/div&gt;
                )}
  
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  <p>Thanks for your time.</p>