-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
36 lines (31 loc) · 949 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
import { useState, useEffect } from "react";
import * as Font from "expo-font";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { RootStackParamList } from "@interfaces/RootStackParamList";
import { Home } from "@screens/Index";
const RootStack = createStackNavigator<RootStackParamList>();
export default function App() {
const [isReady, setIsReady] = useState(false);
const getFonts = async () => {
await Font.loadAsync({
SUIT: require("../assets/fonts/SUIT-Variable.ttf"),
});
};
useEffect(() => {
getFonts();
}, []);
return isReady ? (
<NavigationContainer>
<RootStack.Navigator initialRouteName="Home">
<RootStack.Screen
name="Home"
component={Home}
options={{ headerShown: true }}
/>
</RootStack.Navigator>
</NavigationContainer>
) : (
<></>
);
}