# React Native Navigation | Sentry for React Native

Sentry's React Native SDK package ships with instrumentation for [React Native Navigation](https://github.com/wix/react-native-navigation.md). This allows you to see the performance of your navigation transitions and the errors that occur during them. This page will guide you through setting up the instrumentation and configuring it to your needs.

## [Initialization](https://docs.sentry.io/.md#initialization)

You will need to pass the `Navigation` object imported from the library to initialize our routing instrumentation. It is recommended that you initialize our SDK and the routing instrumentation as early as possible in the lifecycle of your app; this would most likely be before the point where you initialize your screens.

`index.js`

```javascript
import * as Sentry from "@sentry/react-native";
import { Navigation } from "react-native-navigation";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [

    Sentry.reactNativeNavigationIntegration({
      navigation: Navigation,
    }),

  ],
});
```

## [Options](https://docs.sentry.io/.md#options)

You can configure the instrumentation by passing an options object to the constructor:

```javascript
Sentry.reactNativeNavigationIntegration({
  navigation: Navigation, // Navigation from `react-native-navigation`
  routeChangeTimeoutMs: 1_000, // default: 1_000
  enableTabsInstrumentation: true, // default: false
  ignoreEmptyBackNavigationTransactions: true, // default: true
});
```

### [navigation](https://docs.sentry.io/.md#navigation)

This option is required and should be the `Navigation` object imported from the navigation library.

### [routeChangeTimeoutMs](https://docs.sentry.io/.md#routechangetimeoutms)

This option specifies how long the instrumentation will wait for the route to mount after a change has been initiated before the transaction is discarded. The default value is `1_000`.

### [enableTabsInstrumentation](https://docs.sentry.io/.md#enabletabsinstrumentation)

This instrumentation will create a transaction on tab change. By default, only navigation commands create transactions. The default value is `false`.

### [ignoreEmptyBackNavigationTransactions](https://docs.sentry.io/.md#ignoreemptybacknavigationtransactions)

This ensures that transactions that are from routes that've been seen and don't have any spans, are not being sampled. This removes a lot of clutter, making it so that most back navigation transactions are now ignored. The default value is `true`.
