-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
60 lines (51 loc) · 1.68 KB
/
App.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-09-30 15:47:35
* @LastEditTime: 2019-11-21 18:04:27
* @LastEditors: liyamei
*/
import React, { Component } from 'react';
import { DeviceEventEmitter, StyleSheet, StatusBar, View } from 'react-native';
import { YellowBox } from 'react-native';
//引入路由组件
import { AppContainer } from './src/route';
//启动页
import SplashScreen from 'react-native-splash-screen';
//redux
import { Provider } from 'react-redux';
import configureStore from './src/redux/store/store.js';
const store = configureStore();//创建store
export default class App extends React.Component {
constructor(props) {
super(props);
YellowBox.ignoreWarnings([
'Warning: componentWillMount is deprecated',
'Warning: componentWillReceiveProps is deprecated',
'Warning: componentWillMount has been renamed',
'Warning: componentWillReceiveProps has been renamed',
'Warning: componentWillUpdate has been renamed',
'Warning: DatePickerAndroid has been merged with DatePickerIOS and will be removed in a future release',
]);
}
componentDidMount() {
// 组件加载完毕之后,隐藏启动页
this.timer = setTimeout(() => {
SplashScreen.hide();
}, 900)
StatusBar.setBarStyle('dark-content');
}
//卸载计时器
componentWillUnmount() {
this.timer && clearTimeout(this.timer);//同时为真的才执行卸载
}
render() {
return (
<Provider store={store}>
<AppContainer />
</Provider>
);
}
}
const styles = StyleSheet.create({
});