React Native AsyncStorage getItem returns promise not value

前端 未结 2 1353
无人共我
无人共我 2021-02-14 15:32

I have a login form and I am able to post my the form values. After a successful POST request, I get authentication token returned from the API. I need to save this token for fu

2条回答
  •  一整个雨季
    2021-02-14 16:03

    You have to call as

    getUserToken().then(res => {
        console.log(res);
      });
    

    Since this is an async call.

提交回复
热议问题