This is a beta version of the next major version of the Sentry React Native SDK 6.0.0.
Please, read the changes listed below as well as the changes made in the underlying
Sentry Javascript SDK 8.0.0 (JS Docs).
Major Changes
-
React Native Tracing options were moved to the root options
import Sentry from '@sentry/react-native'; Sentry.init({ tracesSampleRate: 1.0, enableAppStartTracking: true, // default true enableNativeFramesTracking: true, // default true enableStallTracking: true, // default true enableUserInteractionTracing: true, // default false integrations: [ Sentry.reactNativeTracingIntegration({ beforeStartSpan: (startSpanOptions) => { startSpanOptions.name = 'New Name'; return startSpanOptions; }, }), Sentry.appStartIntegration({ standalone: false, // default false }), ], });
-
New React Navigation Integration interface (#4003)
import Sentry from '@sentry/react-native'; import { NavigationContainer } from '@react-navigation/native'; const reactNavigationIntegration = Sentry.reactNavigationIntegration(); Sentry.init({ tracesSampleRate: 1.0, integrations: [reactNavigationIntegration], }); function RootComponent() { const navigation = React.useRef(null); return <NavigationContainer ref={navigation} onReady={() => { reactNavigationIntegration.registerNavigationContainer(navigation); }}> </NavigationContainer>; }
-
Removed
beforeNavigate
usebeforeStartSpan
instead (#3998)beforeStartSpan
is executed before the span start, compared tobeforeNavigate
which was executed before the navigation ended (after the span was created)
Dependencies
Other Changes
-
Native Frames uses
spanId
to attach frames replacingtraceId
(#4030) -
Removed deprecated ReactNativeTracing option
idleTimeout
useidleTimeoutMs
instead (#3998) -
Removed deprecated ReactNativeTracing option
maxTransactionDuration
usefinalTimeoutMs
instead (#3998) -
New Native Frames Integration (#3996)
-
New Stall Tracking Integration (#3997)
-
New User Interaction Tracing Integration (#3999)
-
New App Start Integration (#3852)
- By default app start spans are attached to the first created transaction.
- Standalone mode creates single root span (transaction) including only app start data.
-
New React Native Navigation Integration interface (#4003)
import Sentry from '@sentry/react-native'; import { Navigation } from 'react-native-navigation'; Sentry.init({ tracesSampleRate: 1.0, integrations: [ Sentry.reactNativeNavigationIntegration({ navigation: Navigation }) ], });