Overview
The navigation system provides:- React Navigation foundation - Native stack navigator
- Sheet coordination - Synchronized sheet dismissal and navigation
- Virtual navigators - Nested navigation without native stacks
- Bottom sheet integration - Custom bottom sheet navigator
- Global navigation - Navigate from anywhere in the app
- Route tracking - Centralized active route management
Core Navigation
Navigate from Components
Navigate from Anywhere
Route Names
All routes are defined in a central registry:src/navigation/routesNames.ts
Route Types
Navigation Store
The navigation store tracks active routes:src/state/navigation/navigationStore.ts
Using Navigation State
Sheet Coordination
Rainbow coordinates sheet dismissals with navigation to prevent glitches:src/navigation/Navigation.tsx
Usage in Sheets
Virtual Navigators
Virtual navigators provide nested navigation without additional native stacks:src/navigation/virtualNavigators.ts
Creating a Virtual Navigator
Bottom Sheet Navigator
Custom navigator for bottom sheet presentations:src/navigation/bottom-sheet/
Usage
Navigation Ref
Access the navigation ref from anywhere:Route Params
Define and use typed route parameters:src/navigation/types.ts
Access Params
Navigate with Params
Navigation Configuration
Stack Config
src/navigation/nativeStackConfig.ts
Screen Options
Prefetching
Register prefetch functions for screens:src/navigation/prefetchRegistry.ts
Deep Linking
Handle deep links and universal links:Best Practices
Use route constants
Use route constants
Always use route constants from
routesNames.ts:Type your route params
Type your route params
Define params in
RootStackParamList:Coordinate sheet dismissals
Coordinate sheet dismissals
Use
onWillPop and onDidPop for sheets:Prefetch when possible
Prefetch when possible
Register prefetch functions for data-heavy screens:
Common Patterns
Conditional Navigation
Navigation with Confirmation
Reset Navigation Stack
Navigation Events
Next Steps
Storage System
Learn about MMKV persistence
Analytics
Understand event tracking