forked from catchimal/catchimal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
43 lines (41 loc) · 1.06 KB
/
App.js
File metadata and controls
43 lines (41 loc) · 1.06 KB
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
import React, {useState} from 'react';
import { StyleSheet, View, StatusBar } from 'react-native';
import {AppLoading, SplashScreen} from 'expo';
import AppNavigator from "./Screens/AppNavigator";
import {Provider} from "react-redux";
import {createStore} from "redux";
import allReducers from "./Redux/Reducers/Index";
import * as Font from 'expo-font';
export default function App() {
const [appReady, setAppReady] = useState(false);
SplashScreen.preventAutoHide();
const store = createStore(
allReducers,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);
Font.loadAsync({
// load fonts here
}).then(() => {
SplashScreen.hide();
setAppReady(true);
});
if(appReady) {
return (
<Provider store={store}>
<View style={styles.container}>
<StatusBar barStyle="dark-content"/>
<AppNavigator />
</View>
</Provider>
);
} else {
return (
<AppLoading />
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});