gpt4 book ai didi

javascript - 预期的动态类型字符串',但 typeint64 react native

转载 作者:行者123 更新时间:2023-11-30 09:35:21 25 4
gpt4 key购买 nike

我的 React native 应用程序中有这一行,用于在 AsyncStorage 中存储一个变量:

AsyncStorage.setItem('userId',theuser.id);

但是当我运行该应用程序时,它给了我一个错误:

TypeError: expected dynamic type string', but had typeint64 react native

当我想传递的变量是字符串但我不能传递任何对象或 int 变量时它工作正常吗?

最佳答案

在上面的评论中你说你想要传递一个完整的对象,你会这样做:

AsyncStorage.setItem('userId', JSON.stringify(theuser));

关于javascript - 预期的动态类型字符串',但 typeint64 react native ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43858300/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com