如何隐藏或抑制反应本机警告

问题描述 投票:0回答:2

我在反应原生中收到以下警告,我被告知我可以忽略它,但实际的警告很烦人。

错误的实际文本如下...

警告:失败的 propType:所需的 prop

sceneRendererProps.isRequired
未在
SceneView
中指定。检查
NavigationCard
的渲染方法。

有什么方法可以专门消除或抑制此错误消息吗?

react-native
2个回答
3
投票

根据这篇文章

您应该能够执行以下操作...

console.ignoredYellowBox = ['Warning: Failed propType: SceneView'];


0
投票

console.disableYellowBox = true; 添加到您的 index.js 文件中。

© www.soinside.com 2019 - 2024. All rights reserved.