I understand the confusion, but this line uses callbacks, not Promises, so you should not use async / await
it should be:
componentDidMount = () => { firebase.auth().onAuthStateChanged((user) => { if (user) { this.setState({user: user}, () => { this.props.retrieveMatches(this.state.user.uid); }) } }); }
You can use async / await to replace Promises then and catch calls
it
promise.then((result) => {...}).catch((error) => {});
will become
try { const result = await promise(); } catch (error) {
source share