title: Accessing a property from an array of objects stored in state in React
body: <p>I'm working with ReactJS on a project and using KnexJS to access a database. I would like to store and use the JSON objects I retrieve, in the state of a component as something along the lines of the following. </p>
  
  <p><code>this.setState({tutors: tutors}) //Retrieval from database after promise</code></p>
  
  <p>and then access their properties like so</p>
  
  <p><code>this.state.tutors[0].email
  this.state.tutors[0].firstname</code></p>
  
  <p>However, when I try this, I get the following error</p>
  
  <p><code>TypeError: Cannot read property 'email' of undefined</code></p>
  
  <p>I have checked the console.log as well as using JSON.stringify to determine if the objects are retrieved by the time I need them. And it appears that they are. I simply cannot access their properties from state. </p>
  
  <p>Is there something I can do about this? Or do I need to retrieve them from the DB one by one?</p>