React Native Navigation Basic

    0

    0

    Estee Tey

    React Native Recipes

    This is a standard way to declare the RootStackParamList type and create a navigator component that routes the different screens in a react native app.

    import { createNativeStackNavigator } from "@react-navigation/native-stack";
    
    type RootStackParamList = {
        Home: undefined;
        Checkout: undefined;
        Summary: undefined;
    };
    const RootStack = createNativeStackNavigator<RootStackParamList>();
    const NavStack = () => (
        <RootStack.Navigator initialRouteName="Home">
            <RootStack.Screen name={"Home"} component={HomeScreen} />
            <RootStack.Screen name={"Checkout"} component={CheckoutScreen} />
            <RootStack.Screen name={"Summary"} component={SummaryScreen} />
        </RootStack.Navigator>
    );
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.