-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathApp.js
31 lines (26 loc) · 848 Bytes
/
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
import * as SplashScreen from 'expo-splash-screen'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { useFonts } from 'expo-font'
import { useCallback } from 'react'
import { FONTS } from './constants/fonts'
import AppNavigation from './navigations/AppNavigation'
import { ThemeProvider } from './themes/ThemeProvider'
SplashScreen.preventAutoHideAsync()
export default function App() {
const [fontsLoaded] = useFonts(FONTS)
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync()
}
}, [fontsLoaded])
if (!fontsLoaded) {
return null
}
return (
<ThemeProvider>
<SafeAreaProvider onLayout={onLayoutRootView}>
<AppNavigation />
</SafeAreaProvider>
</ThemeProvider>
)
}