Await is a reserved word error

Solution:

In order to use await, the function directly enclosing it needs to be async.
example codes:

async tryGetUserName() {   let session = await Auth.currentSession();   ...... } 

async should be there, otherwise you will get the error.

No comments:

Post a Comment

qz-l.com — A Simple, Clean, and Fast URL Shortener I Built

 Lately, I’ve noticed that many URL shortener services are becoming cluttered — full of ads, tracking, and unnecessary steps. I wanted somet...