-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
38 lines (31 loc) · 1.08 KB
/
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
import React from "react";
import { StatusBar } from "expo-status-bar";
import { NavigationContainer, useNavigationContainerRef } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { RootStackParamList } from "./src/screens/RootStackParams";
import "react-native-gesture-handler";
import { HomeScreen, AboutScreen } from "./src/screens";
const Stack = createStackNavigator<RootStackParamList>();
const App = () => {
const navigationRef = useNavigationContainerRef();
const screens: {
name: keyof RootStackParamList;
component: React.ReactNode;
}[] = [
{ name: "Home", component: HomeScreen },
{ name: "About", component: AboutScreen },
];
return (
<>
<StatusBar style="light" />
<NavigationContainer ref={navigationRef}>
<Stack.Navigator screenOptions={{ headerShown: false, animationEnabled: true }}>
{screens.map((it: any) => (
<Stack.Screen key={it.name} {...it} />
))}
</Stack.Navigator>
</NavigationContainer>
</>
);
};
export default App;