title: Updating a state variable in React Native Expo
body: <p>I dont really understand how setState and state variables update and work in React Native. Im trying to figure out what I did wrong in the code below, because I'm updating my tokenArray variable, but when I console log it in another function it is empty. Please help.</p>
  <pre><code>  constructor() {
      super()
      this.state = {
          tokenArr: []
      }
  }
  
  componentDidMount() {
      this.grabToken()
  }
  
  firebaseInformation = async () =&gt; {
      var tokens = []
      firebase.database().ref(`tokens/`).once('value', snapshot =&gt; {
          const token = Object.values(snapshot.val());
          token.map((item) =&gt; {
              tokens.push(item.data)
          })
          return this.setState({
              tokenArr: tokens
          })
      })
  }
  
  grabToken = async () =&gt; {
      this.firebaseInformation()
      console.log(this.state.tokenArr)
  }
  </code></pre>