[[oktatas:telefon:react_native:navigacio|< Navigáció]] ====== Navigáció függvényekkel ====== * **Szerző:** Sallai András * Copyright (c) Sallai András, 2023 * Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]] * Web: https://szit.hu ===== Verem alapú navigáció ===== ===== Modul telepítése ===== npm install @react-navigation/native @react-navigation/native-stack Expo használata esetén: npx expo install react-native-screens react-native-safe-area-context Tiszta React Native esetén: npm install react-native-screens react-native-safe-area-context ==== Könyvtárszerkezet ==== app01/ |-assets/ |-comps/ | |-HomeScreen.js | `-ProfileScreen.js |-App.js ==== Forráskódok ==== import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import HomeScreen from './comps/HomeScreen'; import ProfileScreen from './comps/ProfileScreen'; const Stack = createNativeStackNavigator(); export default function App() { return ( ); } import { Button } from "react-native"; import { View, Text } from "react-native-web"; export default function HomeScreen({navigation}) { return ( Home