Skip to content

Setup p6: Tab Navigation Type Annotation#9

Merged
pnv2003 merged 2 commits intoN3Mobile:masterfrom
pnv2003:setup
May 26, 2024
Merged

Setup p6: Tab Navigation Type Annotation#9
pnv2003 merged 2 commits intoN3Mobile:masterfrom
pnv2003:setup

Conversation

@pnv2003
Copy link
Copy Markdown
Member

@pnv2003 pnv2003 commented May 26, 2024

Tab Navigation usage:

const route = useRoute<RouteProp<BottomTabParamList, TabScreens.[YOUR_TAB_SCREEN_HERE]>>();
console.log(route.params);
const navigation = useNavigation<TabNavigation>();
navigation.navigate(TabScreens.[YOUR_TAB_SCREEN_HERE], { /* YOUR_PARAMS_HERE */ });

Stack Navigation usage:

type Props = NativeStackScreenProps<RootStackParamList, RootScreens.[YOUR_STACK_SCREEN_HERE]>
// export const YourScreen: FC<Props> = ({ navigation, route }) => { ...

// or
const route = useRoute<RouteProp<RootStackParamList, RootScreens.[YOUR_STACK_SCREEN_HERE]>>();
console.log(route.params);
const navigation = useNavigation<StackNavigation>();
navigation.navigate(RootScreens.[YOUR_STACK_SCREEN_HERE], { /* YOUR_PARAMS_HERE */ });

@pnv2003 pnv2003 merged commit 5a9b4bd into N3Mobile:master May 26, 2024
@pnv2003 pnv2003 added help wanted Extra attention is needed enhancement New feature or request and removed help wanted Extra attention is needed labels May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant