App.tsx 946 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import { NavigationContainer } from '@react-navigation/native';
  3. import { createNativeStackNavigator } from '@react-navigation/native-stack';
  4. import LoginScreen from './src/pages/Login';
  5. import HomeScreen from './src/pages/Home';
  6. const Stack = createNativeStackNavigator();
  7. function App(): React.JSX.Element {
  8. return (
  9. <NavigationContainer>
  10. <Stack.Navigator initialRouteName="Udp">
  11. <Stack.Screen
  12. name="Login"
  13. component={LoginScreen}
  14. options={{
  15. title: '登录',
  16. headerBackVisible: false,
  17. headerShown: false,
  18. }}
  19. />
  20. <Stack.Screen
  21. name="Home"
  22. component={HomeScreen}
  23. options={{
  24. title: '首页',
  25. headerBackVisible: false,
  26. headerShown: false,
  27. }}
  28. />
  29. </Stack.Navigator>
  30. </NavigationContainer>
  31. );
  32. }
  33. export default App;