简体   繁体   中英

React native, error adding a root view

I've been trying to use 'react-native-popup' in my project and rendering the popup gave me the below error in a red screen. If I reload, the message is treated like a warning and the app functions fine, but the error message shows up once in a while. I am wondering what the issue is?

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.

This is how I used it in the render function:

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

If you are getting something like the screenshot below , Please try reloading the app by tapping the reload button. I was getting this error if I made some changes in code that already had some exception/error. I hope this helps as it has worked for me almost every time.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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