如何解决如何在 React Native iOS 模拟器中隐藏警告??
根据 React NativeDocumentationdisableYellowBox
,您可以通过设置如下来隐藏警告消息true
:
console.disableYellowBox = true;
更新:React Native 0.63+
console.disableYellowBox
已删除,现在您可以使用:
import { LogBox } from 'react-native';
LogBox.ignoreLogs(['Warning: ...']); // Ignore log notification by message
LogBox.ignoreAllLogs();//Ignore all log notifications
忽略所有日志通知
解决方法
我刚刚升级了我的 React Native,现在 iOS 模拟器有一堆警告。除了修复它们,我如何隐藏这些警告以便我可以看到下面的内容?
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。