I have a react native app and following is the screen flow-
Splash screen -> login -> FlightList
When I am in flightlist screen, I press back button and it takes me back to splash screen.
I want to exit the app when I press back button in flight screen. I saw some code here NavigationActions.reset is not a function?
import { NavigationActions, StackActions } from 'react-navigation'
const resetAction = StackActions.reset({
index: 0,
key: null, // <-- this
actions: [NavigationActions.navigate({ routeName: route })]
})
this.props.navigation.dispatch(resetAction)
But I am not sure where should I use it. Could any one help me with this please