How can I determine if my React Native app is a debug or release build from JavaScript code?

前端 未结 1 1142
渐次进展
渐次进展 2020-12-29 00:36

I\'d like to add some debug-only UI to my React Native app, but I can\'t find any equivalent of RCT_DEBUG or RCT_DEV compile-time flags in the Java

相关标签:
1条回答
  • 2020-12-29 01:10
    if (__DEV__) {
        console.log('I am in debug');
    }
    

    You can see this approach is being used in React Native repository.

    0 讨论(0)
提交回复
热议问题