title: how to access axios using react
body: <p>im creating a quote generator using react. i'm having trouble accessing the object inside the arrays. viewing all the arrays is fine but when i try to specify which key i need, it says cannot read the property undefined</p>
  
  <pre><code>class Quote extends React.Component{
     state = {
         quotes : []
  
     }
  
  
  componentDidMount(){
  axios.get('https://gist.githubusercontent.com/camperbot/5a022b72e96c4c9585c32bf6a75f62d9/raw/e3c6895ce42069f0ee7e991229064f167fe8ccdc/quotes.json').then(res=&gt;{
  this.setState({
      quotes: res.data.quotes
      })
  })
  }
  render(){
      console.log(this.state.quotes[0])
  </code></pre>
  
  <p>this is the code that is working and it shows a result like this:</p>
  
  <pre><code>   {quote: "Life isn’t about getting and having, it’s about giving and being.", author: "Kevin Kruse"}
  </code></pre>
  
  <p>but when i use this instead:</p>
  
  <pre><code>   console.log(this.state.quotes[0].quote)
  </code></pre>
  
  <p>the error says :</p>
  
  <pre><code>   TypeError: Cannot read property 'quote' of undefined
  </code></pre>