Setting Up Navigation

Setting Up Navigation

Step-1

npm install @react-navigation/native

step-2

npx expo install react-native-screens react-native-safe-area-context

step -3

npm install @react-navigation/native-stack

Step- 4

Add these in app .js

import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeScreen from "./Components/HomeScreen";

export default function App() {
  const Stack = createNativeStackNavigator();

  return (
    <NavigationContainer>
      <Stack.Navigator>
       <Stack.Screen name="home" component={HomeScreen}></Stack.Screen>
      </Stack.Navigator>
    </NavigationContainer>
  );
}

Done Enjoy