title: Async await on component did mount
body: <p>This is my <code>componentDidMount</code> method. I want to set the state of the current user and then call the function when that user is set. How can I do this?</p>
  
  <pre><code>  componentDidMount = () =&gt; {
      firebase.auth().onAuthStateChanged((user) =&gt; {
        if (user) {
          this.setState({user: user})
        }
      });
      this.props.retrieveMatches(this.state.user.uid)
    }
  </code></pre>
  
  <p>I've tried using async/await but im not using it correctly here:</p>
  
  <pre><code>  async componentDidMount = () =&gt; {
      await firebase.auth().onAuthStateChanged((user) =&gt; {
        if (user) {
          this.setState({user: user})
        }
      });
      this.props.retrieveMatches(this.state.user.uid)
    }
  </code></pre>
  
  <p>basically I want to await for lines 2-6 before calling the props function on line 7</p>