home / skills / hoangnguyen0403 / agent-skills-standard / react-native-navigation
This skill helps implement and validate React Native navigation with React Navigation, ensuring strong types, deep links, and safe routing.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill react-native-navigationReview the files below or copy the command above to add this skill to your agents.
---
name: React Native Navigation
description: Navigation and deep linking for React Native using React Navigation.
metadata:
labels: [react-native, navigation, routing, deep-linking, react-navigation]
triggers:
files: ['**/App.tsx', '**/*Navigator.tsx', '**/*Screen.tsx']
keywords:
[
NavigationContainer,
createStackNavigator,
createBottomTabNavigator,
linking,
deep link,
]
---
# React Native Navigation
## **Priority: P1 (OPERATIONAL)**
Navigation and deep linking using React Navigation.
## Guidelines
- **Library**: Use `@react-navigation/native-stack` for native performance.
- **Type Safety**: Define `RootStackParamList` for all navigators.
- **Deep Links**: Configure `linking` prop in `NavigationContainer`.
- **Validation**: Validate route parameters (`route.params`) before fetching data.
[Routing Patterns](references/routing-patterns.md)
## Anti-Patterns
- **No Untyped Navigation**: `navigation.navigate('Unknown')` → Error. Use types.
- **No Manual URL Parsing**: Use `linking.config`, not manual string parsing.
- **No Unvalidated Deep Links**: Handle invalid IDs gracefully (e.g., redirect to Home/404).
## Related Topics
react-native-dls | react-native-notifications | mobile-ux-core
This skill covers navigation and deep linking for React Native using React Navigation, with emphasis on native-stack performance and type safety. It provides practical rules and patterns to implement reliable routes, validate parameters, and handle invalid links gracefully. The guidance is operational priority to ensure runtime stability and predictable UX.
It recommends using @react-navigation/native-stack for native performance and defining a RootStackParamList to enforce navigation types across screens. Deep linking is configured via the linking prop on NavigationContainer, using a linking.config to map URL patterns to route names. Route parameters must be validated before use to avoid crashes and to handle malformed or missing IDs by redirecting or showing fallback screens.
Do I need types for every navigator?
Yes. Define a param list for each navigator so TypeScript can verify route names and parameter shapes.
How should I handle bad deep links?
Validate params on entry and redirect to a safe screen (Home or a 404) rather than attempting to fetch with invalid IDs.