-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
44 lines (36 loc) · 1.09 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
import React, { useCallback, useEffect, useState } from 'react';
import * as Font from 'expo-font';
import * as SplashScreen from "expo-splash-screen";
import AppNavigation from './app/scripts/AppNavigation';
// Keep the splash screen visible while we fetch resources
SplashScreen.preventAutoHideAsync();
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
useEffect(() => {
async function prepare() {
try {
// Pre-load fonts, make any API calls you need to do here
await Font.loadAsync({
'poppins-regular': require('./app/assets/fonts/Poppins-Regular.ttf'),
'poppins-medium': require('./app/assets/fonts/Poppins-Medium.ttf'),
'poppins-semibold' : require('./app/assets/fonts/Poppins-SemiBold.ttf'),
});
} catch (e) {
console.warn(e);
} finally {
// Tell the application to render
setAppIsReady(true);
}
}
prepare();
}, []);
if (!appIsReady) {
return null;
}
else {
SplashScreen.hideAsync();
return (
<AppNavigation/>
);
}
}