我的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
我已经尝试制作此变量的副本,但是它没有任何改变。
我该如何解决? 谢谢:)!