Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 19, 2026·3 min de lecture

React Navigation — Routing and Navigation for React Native

The standard routing library for React Native apps, providing stack, tab, and drawer navigators with deep linking, gestures, and native transitions.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
React Navigation Overview
Commande CLI universelle
npx tokrepo install e97ad877-535b-11f1-9bc6-00163e2b0d79

Introduction

React Navigation is the most widely adopted routing solution for React Native applications. It provides a JavaScript-based navigation system with native-feeling transitions on both iOS and Android. The library supports stack, tab, drawer, and custom navigators, along with deep linking and state persistence.

What React Navigation Does

  • Manages navigation state and screen transitions in React Native apps
  • Provides stack, bottom tab, material top tab, and drawer navigators
  • Supports deep linking with URL-based routing
  • Handles native gestures like swipe-to-go-back on iOS
  • Integrates with TypeScript for type-safe route params

Architecture Overview

React Navigation uses a tree of navigator components that each manage their own state. The NavigationContainer at the root holds the global navigation state and links it to the platform. Each navigator (Stack, Tab, Drawer) renders its screens as React components and manages transitions through a shared navigation context. Screen options, headers, and animations are configured declaratively via props or the options callback.

Self-Hosting & Configuration

  • Install the core package and the navigator you need (native-stack, bottom-tabs, drawer)
  • Wrap your app in <NavigationContainer> as the root provider
  • Install peer dependencies: react-native-screens, react-native-safe-area-context
  • Configure deep linking via the linking prop on NavigationContainer
  • Persist navigation state across restarts with onStateChange and initialState

Key Features

  • Native stack transitions powered by react-native-screens for smooth performance
  • Type-safe navigation with full TypeScript route/param inference
  • URL-based deep linking and web integration
  • Customizable headers, tab bars, and drawer menus
  • State persistence and reset for development and production

Comparison with Similar Tools

  • Expo Router — file-based routing built on top of React Navigation, adds convention over configuration
  • React Native Navigation (Wix) — fully native navigation, better performance for complex stacks but harder to customize
  • React Router Native — web-style routing for RN, smaller community for native use
  • Solito — cross-platform navigation for Next.js + React Native, wraps React Navigation

FAQ

Q: Does it work with Expo? A: Yes, React Navigation is the recommended navigation library for Expo projects.

Q: How do I pass parameters between screens? A: Use navigation.navigate('Details', { itemId: 42 }) and access them via route.params.itemId.

Q: Can I customize the header bar? A: Yes, use screenOptions or the options prop on individual screens to set title, styles, and custom header components.

Q: How do I handle authentication flows? A: Use conditional rendering inside the navigator: show auth screens when not logged in, and main screens when authenticated.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires