-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
42 lines (35 loc) · 966 Bytes
/
App.tsx
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
import * as SplashScreen from "expo-splash-screen";
import * as Font from "expo-font";
import React, { useEffect, useState, useLayoutEffect } from "react";
import { NativeBaseProvider } from "native-base";
import { Inter_500Medium } from "@expo-google-fonts/inter";
import { Provider } from "react-redux";
import { Routes } from "./src/routes";
import { store } from "./src/redux/store";
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
useEffect(() => {
(async () => {
await SplashScreen.preventAutoHideAsync();
await Font.loadAsync({
Inter_500Medium,
});
setAppIsReady(true);
})();
}, []);
useLayoutEffect(() => {
if (appIsReady) {
SplashScreen.hideAsync();
}
}, [appIsReady]);
if (!appIsReady) {
return null;
}
return (
<NativeBaseProvider>
<Provider store={store}>
<Routes />
</Provider>
</NativeBaseProvider>
);
}