Skip to content

Commit

Permalink
fix(samples): Only load browser replay when Expo sample is running on…
Browse files Browse the repository at this point in the history
… web (#4482)
  • Loading branch information
krystofwoldrich authored Jan 24, 2025
1 parent cb6b3a4 commit 0eacc98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/expo/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as Sentry from '@sentry/react-native';
import { ErrorEvent } from '@sentry/core';
import { isExpoGo } from '../utils/isExpoGo';
import { LogBox } from 'react-native';
import { isWeb } from '../utils/isWeb';

export {
// Catch any errors thrown by the Layout component.
Expand Down Expand Up @@ -56,8 +57,10 @@ Sentry.init({
}),
navigationIntegration,
Sentry.reactNativeTracingIntegration(),
Sentry.browserReplayIntegration(),
);
if (isWeb()) {
integrations.push(Sentry.browserReplayIntegration());
}
return integrations.filter(i => i.name !== 'Dedupe');
},
enableAutoSessionTracking: true,
Expand Down
5 changes: 5 additions & 0 deletions samples/expo/utils/isWeb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Platform } from 'react-native';

export function isWeb(): boolean {
return Platform.OS === 'web';
}

0 comments on commit 0eacc98

Please # to comment.