Skip to content

Commit 0eacc98

Browse files
fix(samples): Only load browser replay when Expo sample is running on web (#4482)
1 parent cb6b3a4 commit 0eacc98

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

samples/expo/app/_layout.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as Sentry from '@sentry/react-native';
1010
import { ErrorEvent } from '@sentry/core';
1111
import { isExpoGo } from '../utils/isExpoGo';
1212
import { LogBox } from 'react-native';
13+
import { isWeb } from '../utils/isWeb';
1314

1415
export {
1516
// Catch any errors thrown by the Layout component.
@@ -56,8 +57,10 @@ Sentry.init({
5657
}),
5758
navigationIntegration,
5859
Sentry.reactNativeTracingIntegration(),
59-
Sentry.browserReplayIntegration(),
6060
);
61+
if (isWeb()) {
62+
integrations.push(Sentry.browserReplayIntegration());
63+
}
6164
return integrations.filter(i => i.name !== 'Dedupe');
6265
},
6366
enableAutoSessionTracking: true,

samples/expo/utils/isWeb.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Platform } from 'react-native';
2+
3+
export function isWeb(): boolean {
4+
return Platform.OS === 'web';
5+
}

0 commit comments

Comments
 (0)