0.63之前
console.disableYellowBox = true; //关闭全部黄色警告
console.ignoredYellowBox = [
'Warning: BackAndroid is deprecated. Please use BackHandler instead.',
...
];
0.63之后
import { LogBox } from 'react-native';
LogBox.ignoreAllLogs(true)//关闭全部黄色警告
LogBox.ignoreLogs([
'Warning: BackAndroid is deprecated. Please use BackHandler instead.',
...
])
//LogBox 在发布版本(release/production)中是自动禁用的。