I\'ve got a problem with the navigation of React Navigation and React Native. It is about resetting navigation and returning to the home screen.
I\'ve build a StackN
This is How I do it :
reset(){
return this.props
.navigation
.dispatch(NavigationActions.reset(
{
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Menu'})
]
}));
}
at least replace 'Menu' with 'Home'. You may also want to adapt this.props.navigation to your implementation.
In version > 2 follow this:
import { NavigationActions, StackActions } from 'react-navigation';
const resetAction = StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'MainActivity' })],
});
this.props.navigation.dispatch(resetAction);