简体   繁体   中英

console.error in react-native throws red screen even when __DEV__ is false

I'm building react-native app with Exponent and do some logging with console.error eg when network request fails etc. While it's helpful in development to see this red screen with error on simulator or real device, I'm getting this too when __DEV__ is set to false (seeing it is set so in logs) while the web says it shouldn't work like this.

How can I disable that for non-dev builds? Is there any other way than monkey-patching console.error ?

You are getting this fullscreen error until you run your app in production mode. That means you need to run your iOS/Android app in production.

If you want to do it with iOS you need to change your Scheme to Release

More details can be found here

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