-
Notifications
You must be signed in to change notification settings - Fork 48
/
launcher.js
40 lines (35 loc) · 893 Bytes
/
launcher.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
import React, {Component} from 'react';
import {
AppRegistry,
Navigator
} from 'react-native';
import {Crashlytics} from 'react-native-fabric';
import ErrorUtils from 'ErrorUtils';
import Splash from './src/pages/splash';
class Launcher extends Component {
render() {
let defaultName = "splash";
let defaultComponent = Splash;
return (
<Navigator initialRoute={{name: defaultName, component: defaultComponent}}
renderScene={(route, navigator) => {
let Component = route.component;
return <Component {...route.params} navigator={navigator}/>
}}
/>
)
}
componentDidMount() {
this._fabricInit();
}
_fabricInit() {
ErrorUtils.setGlobalHandler(err => {
if (__DEV__) {
Crashlytics.recordError(err);
console.warn(err);
}
}
)
}
}
AppRegistry.registerComponent('LagouApp', () => Launcher);