-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathignoreWarnings.js
27 lines (24 loc) · 907 Bytes
/
ignoreWarnings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {LogBox} from 'react-native';
if (__DEV__) {
const ignoreWarns = [
'EventEmitter.removeListener',
'[fuego-swr-keys-from-collection-path]',
'Setting a timer for a long period of time',
'ViewPropTypes will be removed from React Native',
'AsyncStorage has been extracted from react-native',
"exported from 'deprecated-react-native-prop-types'.",
'Non-serializable values were found in the navigation state.',
'VirtualizedLists should never be nested inside plain ScrollViews',
"Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'",
];
const warn = console.warn;
console.warn = (...arg) => {
for (const warning of ignoreWarns) {
if (arg[0].startsWith(warning)) {
return;
}
}
warn(...arg);
};
LogBox.ignoreLogs(ignoreWarns);
}