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 works fine as of now:
import { NavigationActions, StackActions } from 'react-navigation'
resetStack = () => {
const navigateAction = NavigationActions.navigate({
routeName: 'Home',
params: {},
action: NavigationActions.navigate({ routeName: 'Home' }),
});
props.navigation.dispatch(navigateAction);
}
Found here in the docs: https://reactnavigation.org/docs/en/navigation-actions.html#reset