title: TypeError: Cannot read property 'question_set' of undefined
body: <p>I'm currently trying to access data from a json that's returned from a server that looks like <a href="https://i.stack.imgur.com/AJbVC.png" rel="nofollow noreferrer">this</a>. However, when i try to console.log question_set (i'm trying to access it so i can render the data), i get a TypeError. Any ideas on how i can render question_set and answer_set?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { Component, Fragment } from 'react';
  import { connect } from 'react-redux';
  
  class tryout extends Component {
      constructor(props) {
        super(props);
        this.state = {
          data: [],
          message: '',
          quiz_taker: null,
          question: null,
          answer: null,
          
        }
      }
    
      componentDidMount() {
        
        const token = this.props.token;
        const API_URL = "/api/quizzes/testquiz";
        const configs = {
          method: 'GET',
          headers: {'Authorization': `Token ${token}`}
        }
    
        fetch(API_URL, configs)
        .then(response =&gt; {
          if (response.status &gt; 400) {
            return this.setState(() =&gt; ({message: 'Something went wrong'}))
          } return response.json();
        })
        .then(data =&gt; {
          this.setState(() =&gt; ({data: data,
            message: 'Success'}))
        })
       
      }
    
      render() {
        const details = this.state.data.quiz.question_set[0].label
        console.log(details);
        
        return (
          &lt;div&gt;test&lt;/div&gt;
          
        )
        
       }
     }
     export default connect((state) =&gt; ({token: state.auth.token}))(tryout);</code></pre>
  </div>
  </div>
  </p>