React Navigation
React Navigation is the most popular navigation library for React Native. It provides a JavaScript-based navigation solution that works on both iOS and Android.React Navigation is not part of React Native core. You need to install it separately:
Basic Navigation Setup
Navigation Prop
Every screen component receives anavigation prop automatically:
Passing Parameters
Pass data between screens:- Sending Params
- Receiving Params
Stack Navigator
The most common navigator. Screens stack on top of each other:Tab Navigator
For bottom tab navigation:Drawer Navigator
For side drawer navigation:Nested Navigators
Combine different navigator types:Header Customization
- Custom Title
- Hide Header
- Custom Header
Navigation Lifecycle
React to navigation events:Deep Linking
Handle URLs that open your app:Authentication Flow
Common pattern for login/logout:Programmatic Navigation
Navigate from outside components:Best Practices
Use TypeScript for type-safe navigation
Use TypeScript for type-safe navigation
Keep navigation logic in screens
Keep navigation logic in screens
Handle back button on Android
Handle back button on Android
Lazy load screens
Lazy load screens
Use React.lazy() for screens that aren’t immediately needed.
Cache expensive screen data
Cache expensive screen data
Don’t refetch data every time user navigates back to a screen.
Common Patterns
Modal Screen
Reset Navigation State
Alternative: Native Navigation
For apps requiring native performance, consider:- React Native Navigation (Wix): Uses native navigation primitives
- React Native Screens: Provides native screen optimization
Next Steps
React Navigation Docs
Official React Navigation documentation
Components and APIs
Learn more about React Native components