-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
31 lines (26 loc) · 879 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
/* eslint-disable no-undef */
import * as SplashScreen from 'expo-splash-screen'
import { useFonts } from '@expo-google-fonts/inter'
import { View } from 'react-native'
import Toast from 'react-native-toast-message'
import Routes from './src/routes'
import { toastConfig } from './src/config/toast.config'
import React, { useCallback } from 'react'
SplashScreen.preventAutoHideAsync()
export default function App() {
const [fontsLoaded] = useFonts({
'Inter-Regular': require('./assets/fonts/Inter-Regular.ttf'),
'Inter-Bold': require('./assets/fonts/Inter-Bold.ttf'),
})
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) await SplashScreen.hideAsync()
}, [fontsLoaded])
if (!fontsLoaded) return null
return (
<>
<Routes />
<Toast config={toastConfig} />
<View onLayout={onLayoutRootView}></View>
</>
)
}