title: Trying to access items from an array in state
body: <p>Im trying to access a array in my state in a function. I currently have filled the array like this: </p>
  
  <pre><code>loadFollowing() {
  var newFollowing = this.state.following
  const db = firebase.firestore()
  db.collection('users')
    .doc(this.state.uid)
    .collection('following')
    .get()
    .then(snapshot =&gt; {
      snapshot.forEach(doc =&gt; {
        var newFollower = {
          id: doc.id
        }
        newFollowing.push(newFollower)
  
      })
      this.setState({
        following: newFollowing
      })
  
    })
  </code></pre>
  
  <p>then in another function im trying to access elements of this.state.following like this: </p>
  
  <pre><code>loadPosts() {
  var newPostList = this.state.postList
  var newFollowing = this.state.following
  const db = firebase.firestore()
  const postCollection = db.collection('posts')
  for (let object of newFollowing) {
    postCollection
      .where('creatorId', '==', object.id)
      .get()
      .then(snapshot =&gt; {
        snapshot.forEach(doc =&gt; {
          var postItem = {
            username: doc.data().username,
            content: doc.data().content,
            creatorId: doc.data().creatorId,
            workoutId: doc.data().workoutId,
            id: doc.id
          }
          newPostList.push(postItem)
        })
      })
      this.setState({
        postList: newPostList
      })
  }
  </code></pre>
  
  <p>But newFollowing turns up empty, does anyone know what to do? </p>