Closed iMerica closed 4 years ago
This is a very clunky API for resetting the stack state:
const resetAction = StackActions.reset({ index: 0, actions: [NavigationActions.navigate({ routeName: 'ReportHome'})], }); this.props.navigation.dispatch(resetAction);
It would be great if we could do something like this instead:
this.props.navigation.navigate('ReportHome').then(() => { this.props.navigation.reset() })
This way after you've gone back to the home screen, all the stacks are globally reset and when you click on a tab again, it won't take you to where you left off.
Closing since React Navigation 5 implements a simpler reset, i.e. just pass the new state to use:
navigation.reset(newState)
This is a very clunky API for resetting the stack state:
It would be great if we could do something like this instead:
This way after you've gone back to the home screen, all the stacks are globally reset and when you click on a tab again, it won't take you to where you left off.