title: React - Cant access rates from state (api call)
body: <pre><code>import React, { Component } from 'react';
  import axios from 'axios';
  
  class SearchCurrency extends Component {
    constructor() {
      super();
      this.state = {
        data: {}
      }
    }
  
    componentDidMount() {
      axios
        .get('http://data.fixer.io/api/latest?access_key=b0ab4945712b358052a8fc54d02e7b3d&amp;base=EUR&amp;symbols=USD,CAD,CHF,GBP,AUD')
        .then(res =&gt; 
            this.setState({
              data: res.data
            })
          )
        .catch(err =&gt; console.log(err))
  
    //api call here
  
    }
    render() {
  </code></pre>
  
  <p>for some reason i cant access rates obj within state</p>
  
  <pre><code> const test = this.state.data.rates
  
    i try to map through obj here
    // const obj = Object.keys(test).map(i =&gt; test[i])
  
      console.log(test);
  
      // const map = test.map(i =&gt; &lt;li&gt;{i}&lt;/li&gt;)
      return (
        &lt;div&gt;
          {/* {map} */}
        &lt;/div&gt;
      )
    }
  }
  export default SearchCurrency;
  </code></pre>
  
  <p>thank you</p>