forked from artsy/eigen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-common.js
35 lines (29 loc) · 984 Bytes
/
index-common.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
global.__TEST__ = false
global.__STORYBOOK__ = false
// for more info about metaflags, look [here](/docs/metaflags.md)
let metaflags = {
startStorybook: false,
}
if (__DEV__) {
const {
mockSyncFunctionsWhenDebugging,
} = require("./src/app/system/devTools/mockSyncFunctionsWhenDebugging")
// Ensure we don't break the debugger
mockSyncFunctionsWhenDebugging()
try {
const fileContents = require("./metaflags.json")
metaflags = { ...metaflags, ...fileContents }
} catch {}
}
require("./src/app/system/errorReporting/sentrySetup").setupSentry({ environment: "bootstrap" })
import "react-native-url-polyfill/auto"
if (metaflags.startStorybook) {
global.__STORYBOOK__ = true
require("./src/app/storybook")
} else {
const appName = require("./app.json").appName
require("react-native-gesture-handler")
const { AppRegistry } = require("react-native")
const { App } = require("./src/app/App")
AppRegistry.registerComponent(appName, () => App)
}