File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {NavigationContainer} from '@react-navigation/native'
2222
2323import { RootStack } from './navigation'
2424import { LoadingView } from '@frogpond/notice'
25+ import { IS_PRODUCTION } from '@frogpond/constants'
2526import { StatusBar , useColorScheme } from 'react-native'
2627
2728export default function App ( ) : JSX . Element {
@@ -31,6 +32,15 @@ export default function App(): JSX.Element {
3132 const theme = scheme === 'dark' ? CombinedDarkTheme : CombinedLightTheme
3233 const statusBarStyle = scheme === 'dark' ? 'light-content' : 'dark-content'
3334
35+ const registerContainer = ( ) => {
36+ if ( ! IS_PRODUCTION ) {
37+ return
38+ }
39+
40+ // Register the navigation container with the instrumentation
41+ sentryInit . routingInstrumentation . registerNavigationContainer ( navigationRef )
42+ }
43+
3444 return (
3545 < ReduxProvider store = { store } >
3646 < PersistGate
@@ -43,15 +53,7 @@ export default function App(): JSX.Element {
4353 >
4454 < PaperProvider theme = { theme } >
4555 < ActionSheetProvider >
46- < NavigationContainer
47- onReady = { ( ) => {
48- // Register the navigation container with the instrumentation
49- sentryInit . routingInstrumentation . registerNavigationContainer (
50- navigationRef ,
51- )
52- } }
53- theme = { theme }
54- >
56+ < NavigationContainer onReady = { registerContainer } theme = { theme } >
5557 < StatusBar barStyle = { statusBarStyle } />
5658 < RootStack />
5759 </ NavigationContainer >
You can’t perform that action at this time.
0 commit comments