UNPKG

1.37 kBJavaScriptView Raw
1// AppRegistry transitively installs YellowBox as a side effect, which overrides various console
2// methods that we need to set up before we override them
3import { AppRegistry } from 'react-native';
4AppRegistry; // eslint-disable-line @babel/no-unused-expressions
5// NOTE(2018-10-29): temporarily filter out cyclic dependency warnings here since they are noisy and
6// each warning symbolicates a stack trace, which is slow when there are many warnings
7// NOTE(2019-05-27): temporarily filter out LottieAnimationView warnings triggered by
8// unmaintained react-native-safe-module dependency.
9const originalWarn = console.warn;
10console.warn = function warn(...args) {
11 if (args.length > 0 &&
12 typeof args[0] === 'string' &&
13 (/^Require cycle: .*node_modules/.test(args[0]) ||
14 /Use UIManager\.getViewManagerConfig\('LottieAnimationView'\) instead\./.test(args[0]) ||
15 /ReactNative\.NativeModules\.LottieAnimationView\.getConstants/.test(args[0]))) {
16 return;
17 }
18 originalWarn.apply(console, args);
19};
20const originalError = console.error;
21console.error = function error(...args) {
22 if (args.length > 0 &&
23 typeof args[0] === 'string' &&
24 /^Warning: .* has been extracted/.test(args[0])) {
25 return;
26 }
27 originalError.apply(console, args);
28};
29//# sourceMappingURL=react-native-logs.fx.js.map
\No newline at end of file