Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 15f240e

Browse files
lindboebitsandfoxes
authored andcommittedApr 24, 2025
Fix Expo Go check (#13036)
StoreClient means it _is_ Expo Go, so this predicate was doing the opposite of what it intended. Regardless, there's a more obvious check if the app is running in Expo Go, and it's what is recommended by the Expo docs: https://docs.expo.dev/guides/using-sentry/#initialize-sentry
1 parent 6a9588a commit 15f240e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎docs/platforms/react-native/tracing/instrumentation/expo-router.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The code snippet below shows how to initialize the instrumentation.
1313
```javascript {6-8, 15-16, 20-25} {filename: app/_layout.tsx}
1414
import React from 'react';
1515
import { Slot, useNavigationContainerRef } from 'expo-router';
16-
import Constants, { ExecutionEnvironment } from 'expo-constants';
16+
import { isRunningInExpoGo } from 'expo';
1717
import * as Sentry from '@sentry/react-native';
1818

1919
const navigationIntegration = Sentry.reactNavigationIntegration({
20-
enableTimeToInitialDisplay: Constants.executionEnvironment === ExecutionEnvironment.StoreClient, // Only in native builds, not in Expo Go.
20+
enableTimeToInitialDisplay: !isRunningInExpoGo(),
2121
});
2222

2323
Sentry.init({
@@ -28,7 +28,7 @@ Sentry.init({
2828
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
2929
tracesSampleRate: 1.0,
3030
integrations: [navigationIntegration],
31-
enableNativeFramesTracking: Constants.executionEnvironment === ExecutionEnvironment.StoreClient, // Only in native builds, not in Expo Go.
31+
enableNativeFramesTracking: !isRunningInExpoGo(),
3232
});
3333

3434
function RootLayout() {

0 commit comments

Comments
 (0)
Please sign in to comment.