获取键的每个值并将其用作AsyncStorage中的变量

时间:2020-05-05 17:33:36

标签: react-native asyncstorage

如何获取每个项目并将其更改为变量?我将尝试将它们传递给我的令牌,并获取保存在异步存储中的用户数据。

 const items = ['token', 'user'];
  AsyncStorage.multiGet(items, (_err, stores) => {
    stores.map((result, i, store) => {
//it display two lines of arrays which is token and user with their value'
      console.log(result);
    });
  });

enter image description here

0 个答案:

没有答案