i'm trying to close multiple view in a Stack Navigator without ugly animation. The app structure is like this :
Tab navigator :
- Screen 1
- Screen 2
- Screen 3
StackNavigator :
- Tab navigator(routeName : Home) => Registration View => Login View
Screen 2 have a button to open Registration View in Stack Navigator, and Registration View can open Login View.
When I log in, I want to dismiss Login and Registration view, and go back to Screen 2, with only one animation.
I've tried with this :
NavigationActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Home' }),
],
})
like I saw in a similar question, but it is not the expected behavior. With this code we can see the two view (Login and Registration) dismiss animation successively, and the Tab Navigator goes back to Screen 1.
I've tried too with NavigationsActions.back
, but nothing happens when I set the param ({key: 'Home'})
(I've tried with Home, RegistrationView, and the "key" value found in the navigatorState routes).
How can I do this properly ? Hope you can help me, thanks.