File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
22import { StyleSheet } from 'react-native' ;
33
44import { GestureHandlerRootView } from 'react-native-gesture-handler' ;
5- import { NavigationContainer } from '@react-navigation/native' ;
5+ import { NavigationContainer , useNavigationContainerRef } from '@react-navigation/native' ;
66import Instabug , {
77 CrashReporting ,
88 InvocationEvent ,
@@ -20,6 +20,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
2020const queryClient = new QueryClient ( ) ;
2121
2222export const App : React . FC = ( ) => {
23+ const navigationRef = useNavigationContainerRef ( ) ;
2324 useEffect ( ( ) => {
2425 Instabug . init ( {
2526 token : 'deb1910a7342814af4e4c9210c786f35' ,
@@ -33,11 +34,15 @@ export const App: React.FC = () => {
3334 } ) ;
3435 } , [ ] ) ;
3536
37+ useEffect ( ( ) => {
38+ Instabug . setNavigationListener ( navigationRef ) ;
39+ } , [ navigationRef ] ) ;
40+
3641 return (
3742 < GestureHandlerRootView style = { styles . root } >
3843 < NativeBaseProvider theme = { nativeBaseTheme } >
3944 < QueryClientProvider client = { queryClient } >
40- < NavigationContainer onStateChange = { Instabug . onStateChange } theme = { navigationTheme } >
45+ < NavigationContainer theme = { navigationTheme } ref = { navigationRef } >
4146 < RootTabNavigator />
4247 </ NavigationContainer >
4348 </ QueryClientProvider >
You can’t perform that action at this time.
0 commit comments