title: Possible Unhandled Promise Rejection (id:0) Error: network error in react native
body: <p>Possible Unhandled Promise Rejection (id:0) Error: network error in react native</p>
  
  <pre><code>   import React, {Component} from 'react';
     import {View,Text} from 'react-native';
     import axios from 'axios';
  
     class AlbumList extends Component {
      state = {albums: []};  
     componentWillMount() {
      axios.get('https://rallycoding.herokuapp.com/api/music_albums')
      .then(response=&gt;this.setState({albums: response.data}));
  }
  renderAlbums() {
  return this.state.albums.map(album =&gt; &lt;Text&gt;{album.title}&lt;/Text&gt;);
  }    
  
  render() {
      console.log(this.state);
  return(
  &lt;View&gt;
    {this.renderAlbums()}
  &lt;/View&gt;
  );
  }
  };
  
  export default AlbumList;
  </code></pre>
  
  <p>// I can't load my data from the given link, also in debugging mode there's only //one state created which has empty values and no other data can be visible in //console so help me in fetching the data</p>
  
  <p>Here is screenshot of error I'm getting</p>
  
  <p><a href="https://i.stack.imgur.com/y9MnU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y9MnU.png" alt="enter image description here"></a></p>