react-native-navigation
React Navigation 6+ standards for stack, tab, and deep linking. Use when implementing React Navigation stacks, tabs, or deep linking in React Native.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
React Native Navigation
Priority: P0 (CRITICAL)
Use React Navigation (official solution).
Implementation Guidelines
- Typed Navigation: Use TypeScript to define param lists.
-
Centralized: Define all navigators in
src/navigation/. - Nesting: Nest navigators (e.g., Tab inside Stack).
-
Options: Set
screenOptionsat navigator level, override per screen. -
Header: Customize with
headerTitle,headerRight,headerLeft. -
Deep Linking: Configure
linkingconfig for universal links.
Code
type RootStackParamList = {
Home: undefined;
Profile: { userId: string };
};
// Typed Navigation
const Stack = createNativeStackNavigator<RootStackParamList>();
function RootNavigator() {
return (
<Stack.Navigator>
<Stack.Screen name='Home' component={HomeScreen} />
<Stack.Screen name='Profile' component={ProfileScreen} />
</Stack.Navigator>
);
}
// Usage in Screen
function HomeScreen({
navigation,
}: NativeStackScreenProps<RootStackParamList, 'Home'>) {
navigation.navigate('Profile', { userId: '123' });
}
Anti-Patterns
- No String Literals: Use typed params.
- No Navigation in Business Logic: Pass callbacks from screens.
- No Deep Nesting: Max 2-3 levels of navigators.
Reference & Examples
See references/deep-linking.md for Universal Links, Nested Navigators, and State Persistence.
Related Topics
architecture | typescript/language
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!