title: Accessing JSON in state - ReactNative
body: <p>For my ReactNative proejct: I'm currently trying to access a weather API and retrieve a .json file, store it in my state variable, and then access relevant objects within the .json file (ex: the current temperature, etc). </p>
  
  <p>I'm able to access the entire .json file through my component's State. However, when I try to access objects (ex: current temperature), I get this error. I'm pretty sure I'm using the correct JSON key names to access it, so not sure what's wrong.</p>
  
  <pre><code>TypeError: Cannot read property 'temp_c' of undefined
  </code></pre>
  
  <p>Here's my code:</p>
  
  <pre><code>class App extends Component {
    state = {weatherResponse: []}; // the state of the App component
  
    componentWillMount() {
      axios.get('http://api.apixu.com/v1/current.json?key=KEY&amp;q=Paris')
        .then(
          function(response) {
            //console.log(response.data);
            this.setState({weatherResponse: response.data}); //here, I store the json file into the state.
          }.bind(this)
        );
    }
  
    render() {
      console.log(this.state.weatherResponse); //this works, no problem.
      console.log(this.state.weatherResponse.current.temp_c); //this returns the error below.
  </code></pre>
  
  <p>Here's the JSON file:</p>
  
  <pre><code>{
    "location": {
       "name": "Paris",
       "region": "Ile-de-France",
       "country": "France",
    },
    "current": {
       "last_updated_epoch": 1517616126,
       "last_updated": "2018-02-03 01:02",
       "temp_c": 2,
       "temp_f": 35.6,
       "is_day": 0,
       "cloud": 75
    }
  }
  </code></pre>
  
  <p>Can you please help? Thanks!</p>