Skip to content

Latest commit

 

History

History
34 lines (32 loc) · 920 Bytes

navigation.md

File metadata and controls

34 lines (32 loc) · 920 Bytes

Navigation

Navigation is use to navigate from one screen to diffrent screen

usage

  1. Add static name in router_path.ts file inside mobile/src/navigation
class RoutePaths {
 static screen: string = 'screen';
 ### New name to add here 
 static name : type = 'name'
}
  1. Add Your screen inside app_router.ts
 <Stack.Navigator>
        <Stack.Screen name={RoutePaths.screen} component={Screen} />
         ### New Screen you want to add
           <Stack.Screen name={RoutePaths.screenname} component={your_screen_name} />
      </Stack.Navigator>
  1. To navigate to diffrent screen.
  • import useNavigaiton from @react-navigation/native
import {useNavigation} from '@react-navigation/native';
  • create const for navigaiton as below.
const navigation = useNavigation()
  • To navigate to diffrent screen on any event.
navigation.navigate("screen_name")