diff --git a/samples/react-native/src/App.tsx b/samples/react-native/src/App.tsx index 02b4fd2827..23c69e6907 100644 --- a/samples/react-native/src/App.tsx +++ b/samples/react-native/src/App.tsx @@ -30,16 +30,12 @@ import GesturesTracingScreen from './Screens/GesturesTracingScreen'; import { LogBox, Platform, StyleSheet, View } from 'react-native'; import Ionicons from 'react-native-vector-icons/Ionicons'; import PlaygroundScreen from './Screens/PlaygroundScreen'; -import { clearSentryOptionsFromFile, logWithoutTracing, shouldUseAutoStart } from './utils'; +import { logWithoutTracing, shouldUseAutoStart } from './utils'; import { ErrorEvent } from '@sentry/core'; import HeavyNavigationScreen from './Screens/HeavyNavigationScreen'; import WebviewScreen from './Screens/WebviewScreen'; import { isTurboModuleEnabled } from '@sentry/react-native/dist/js/utils/environment'; -if (shouldUseAutoStart()) { - clearSentryOptionsFromFile(); -} - if (typeof setImmediate === 'undefined') { require('setimmediate'); } @@ -105,7 +101,7 @@ Sentry.init({ return integrations.filter(i => i.name !== 'Dedupe'); }, tracePropagationTargets: ['localhost', /^\//, /^https:\/\//, /^http:\/\//], - // autoInitializeNativeSdk: true, + autoInitializeNativeSdk: shouldUseAutoStart(), }); const Stack = isMobileOs diff --git a/samples/react-native/src/utils.ts b/samples/react-native/src/utils.ts index 33ccfdf084..437787dcc3 100644 --- a/samples/react-native/src/utils.ts +++ b/samples/react-native/src/utils.ts @@ -26,12 +26,3 @@ export function shouldUseAutoStart(): boolean { return false; } } - -export function clearSentryOptionsFromFile() { - ( - globalThis as { - __SENTRY_OPTIONS__?: Record; - } - ).__SENTRY_OPTIONS__ = undefined; - logWithoutTracing('Sentry options from file cleared.'); -}