如何在React.js中解析JSON Firebase

我的Firebase数据库中有一个string类型的字段widgetJSON,我使用Redux将其提供给我的React组件。当我尝试在任何函数中使用JSON.parse(this.props.widgetJSON)作为JSON对象时,出现以下错误:

Unhandled Rejection (Error): A cross-origin error was thrown. React doesn't have access to the actual error object in development.

编辑:在Firefox上出现错误

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

我已经尝试制作此变量的副本,但是它没有任何改变。

我该如何解决? 谢谢:)!

gswgyh727 回答:如何在React.js中解析JSON Firebase

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3134965.html

大家都在问