DEV Community

Discussion on: I just don't understand async/await 😢!

Collapse
 
manan30 profile image
Manan Joshi

Hey, do you have a working copy like a codepen or codesandbox where the error can be reproduced? Also, there is no need for the then callback to be async here

usersRef.get()
        .then(async (docSnapshot) => {
          if (docSnapshot.exists) {
            console.log('user already exists in firestore')
            return true
          } else {
            console.log('no user in firestore')
            return false
          }
        })