Skip to main content
Most mobile apps have multiple screens. Navigation is how users move between these screens. React Native doesn’t include built-in navigation - instead, you use a library like React Navigation.

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

1

Create a Navigator

2

Create Screen Components

Every screen component receives a navigation prop automatically:

Passing Parameters

Pass data between screens:

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

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

Define route params with TypeScript to catch errors at compile time.
Don’t pass navigation prop down through multiple components. Use navigation from context instead.
Use useFocusEffect or BackHandler to handle Android’s back button correctly.
Use React.lazy() for screens that aren’t immediately needed.
Don’t refetch data every time user navigates back to a screen.

Common Patterns

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