javascript - React native,添加 Root View 时出错

标签 javascript android reactjs react-native

我一直在尝试在我的项目中使用“react-native-popup”,渲染弹出窗口时在红屏中出现以下错误。如果我重新加载,该消息将被视为警告,应用程序运行正常,但错误消息偶尔会出现。我想知道这是什么问题?

Trying to add a root view with an explicit id already set. React Native uses the id field to track react tags and will overwrite this field. If that is fine, explicitly overwrite the id field to View.NO_ID before calling addMeasuredRootView.

这是我在渲染函数中使用它的方式:

<Popup ref={popup => this.popup = popup }/>

最佳答案

如果您遇到类似下面屏幕截图的问题,请尝试通过点击重新加载按钮重新加载应用程序。如果我对已经有一些异常/错误的代码进行了一些更改,我就会收到此错误。我希望这对我有所帮助,因为它几乎每次都对我有用。

enter image description here

关于javascript - React native,添加 Root View 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44710520/

相关文章:

javascript - 使用旧状态的 PayPal 智能支付按钮

javascript - 找到字符串中最长的连续字符串模式并将其删除

javascript - 当表单字段的名称带有括号时,如何使用 Javascript 将光标强制到特定的表单字段?

Android ADT Eclipse 布局编辑器给出 StackOverflowErrors

reactjs - 创建新的React应用程序后,在安装后导入软件包或将其包含在index.html中有什么区别?

reactjs - react js : Input element renders differently compared to other elements

javascript - 如何使用循环访问值隐藏元素

javascript - 如何让我的事件监听器响应 DOM 对象 "ended"?

android - 在单例私有(private)构造函数类上使用 hilt 进行依赖注入(inject)

android - 移动共享对话框上的 Facebook 共享按钮被切掉