Skip to main content

Getting started

React Navigation is a navigation library for React Native and Web. It provides routing logic and UI common on mobile apps and PWAs with type-safe navigation, built-in universal links on mobile, and browser history integration on the web.

Starter template

You can use the React Navigation template to quickly set up a new project:

npx create-expo-app@latest --template react-navigation/template

This creates a new Expo project with React Navigation already installed and configured. See the project's README.md for more information, then move on to Setting up React Navigation.

Installation

The @react-navigation/native package contains the core functionality of React Navigation.

In your project directory, run:

npm install @react-navigation/native
Minimum requirements
  • react-native >= 0.72.0
  • expo >= 52 (if you use Expo Go)
  • typescript >= 5.0.0 (if you use TypeScript)

Installing dependencies

Next, install the dependencies used by most navigators: react-native-screens and react-native-safe-area-context.

In your project directory, run:

npx expo install react-native-screens react-native-safe-area-context

This will install versions of these libraries that are compatible with your Expo SDK version.

Setting up React Navigation

The guides linked below cover the fundamentals of React Navigation, and give you the background to dive deeper into the more advanced topics.

When using React Navigation, you configure navigators in your app. Navigators handle transitions between screens and provide UI such as headers, tab bars, etc.

There are 2 ways to configure navigators: