界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

react-native-navigation

react-native-navigation

【效率与协作】Configure stack navigation, type-safe routes, deep linking, and URL-based routing with React Navigation in React Native. Use for React Navigation route configuration; defer unrelated performance, notification, build, and styling work.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: react-native-navigation description: Configure stack navigation, type-safe routes, deep linking, and URL-based routing with React Navigation in React Native. Use for React Navigation route configuration; defer unrelated performance, notification, build, and styling work. metadata: triggers: files: - '/App.tsx' - '/*Navigator.tsx' - '**/*Screen.tsx' keywords: - NavigationContainer - createNativeStackNavigator - createBottomTabNavigator - linking - deep link

React Native Navigation — Deep Linking

Priority: P1 (HIGH)

Deep-linking companion to react-native-navigation-v6, which owns stack/tab/drawer setup and auth-flow structure. For new Expo projects, prefer Expo Router (file-based, built on React Navigation) — see react-native-architecture for the decision criteria.

Configure Type-Safe Navigation

  • 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.

See routing patterns for type-safe stack setup and deep linking configuration.

Anti-Patterns

  • No Untyped Navigation: navigation.navigate('Unknown') leads to errors. Use typed params.
  • 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).

References

See references/routing-patterns.md for typed param lists and deep linking config.

Canonical response anchors

When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:

  • Configure
  • Handle
我的收藏