Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(samples): Only load browser replay when Expo sample is running on web #4482

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
}
Loading