forked from synonymdev/bitkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (36 loc) · 1.45 KB
/
index.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { AppRegistry, LogBox, Text, TextInput } from 'react-native';
import { gestureHandlerRootHOC } from 'react-native-gesture-handler';
import Root from './Root';
import { name as appName } from './app.json';
// TEMP: disable font scaling for globally
Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;
TextInput.defaultProps = TextInput.defaultProps || {};
TextInput.defaultProps.allowFontScaling = false;
if (__DEV__) {
const ignoreList = [
'Require cycle',
// TEMP: ignore <Dialog /> warning on iOS
'Modal with',
// https://reactnavigation.org/docs/troubleshooting/#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state
'Non-serializable values were found in the navigation state',
// we have react-native-draggable-flatlist inside <ScrollView /> on main screen
// unfortunalty, there is not good way to hide this error yet
// https://github.com/computerjazz/react-native-draggable-flatlist/issues/422
'VirtualizedLists should never be nested inside plain ScrollViews',
];
// ignore warnings
LogBox.ignoreLogs(ignoreList);
// ignore errors
const errorWarn = global.console.error;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
global.console.error = (...arg) => {
for (const error of ignoreList) {
if (arg[0].startsWith(error)) {
return;
}
}
errorWarn(...arg);
};
}
AppRegistry.registerComponent(appName, () => gestureHandlerRootHOC(Root));