Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup p6: Tab Navigation Type Annotation #9

Merged
merged 2 commits into from
May 26, 2024
Merged

Conversation

pnv2003
Copy link
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
1 check failed
@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