简体   繁体   English

在我的react native项目中安装Parse SDK时,它显示找不到变量:localStorage错误

[英]When installing the Parse SDK in my react native project then it shows Can't find variable: localStorage error

When I install parse library in my existing project in react-native then it shows can't find variable: localStorage Error and break my app. 当我在react-native中的现有项目中安装解析库时,它显示找不到变量:localStorage错误并中断我的应用程序。

When I used install.save method then it shows the error. 当我使用install.save方法时,它将显示错误。

let install = new Parse.Installation();
        install.set("deviceType", navigator.userAgent);
        install.save().then((resp) => {
        console.log('Created install object', resp); })
         this.setState({
          result: 'New object created with objectId: ' + resp.id
         })
        },err => {
        console.log('Error creating install object', err);
        this.setState({
          result: 'Failed to create new object, with error code: ' + err.message
        })
      })

我得到了解析库问题的解决方案,我升级了库并解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM