-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
32 lines (29 loc) · 1.01 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
import React, { useState } from "react";
import { StatusBar } from "react-native";
import { useFonts } from "@use-expo/font";
import MainStackNavigator from "components/containers/main-stack-navigator";
import { StateProvider, initializeState, reducers } from "state";
import { AppLoading } from "expo";
export default function App() {
const [isAppLoaded, setIsAppLoaded] = useState(false);
const [initialState, setInitialState] = useState({});
let [fontsLoaded] = useFonts({
"Plex-mono": require("./assets/fonts/IBMPlexMono-Regular.otf"),
"Plex-sans": require("./assets/fonts/IBMPlexSans-Regular.otf"),
});
if (!isAppLoaded || !fontsLoaded) {
return (
<AppLoading
startAsync={() => initializeState(setInitialState)}
onFinish={() => setIsAppLoaded(true)}
onError={console.warn}
/>
);
}
return (
<StateProvider initialState={initialState} reducer={reducers}>
<StatusBar barStyle="dark-content" />
<MainStackNavigator />
</StateProvider>
);
}