-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
43 lines (36 loc) · 1.08 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
43
/**
* @format
*/
import {warmupDb} from "@app/modules/sqlUtil"
import {AppRegistry} from "react-native"
import "react-native-gesture-handler"
import {
getUnhandledPromiseRejectionTracker,
setUnhandledPromiseRejectionTracker,
} from "react-native-promise-rejection-utils"
import App from "./App"
import {name as appName} from "./app.json"
const prevTracker = getUnhandledPromiseRejectionTracker()
if (__DEV__) {
const ignoreWarns = [
"VirtualizedLists should never be nested inside plain ScrollViews",
]
const errorWarn = global.console.error
global.console.error = (...arg) => {
for (const error of ignoreWarns) {
if (typeof arg[0] === "string" && arg[0].startsWith(error)) {
return
}
}
errorWarn(...arg)
}
}
setUnhandledPromiseRejectionTracker((id, error) => {
console.warn("Unhandled promise rejection!", id, error)
if (prevTracker !== undefined) {
prevTracker(id, error)
}
})
AppRegistry.registerComponent(appName, () => App)
// Kickoff setting up the DB, including potentially downloading an updated DB, at app startup.
warmupDb()