Closed
Description
How can I reset the navigation stack without this animation?
My code:
resetTabAction = NavigationActions.navigate({
routeName: 'Dashboard',
action: NavigationActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'DashboardInitial' })],
}),
});
props.navigation.dispatch(resetTabAction);
Activity
[-]Hot to reset the navigation stack without animation?[/-][+]How to reset the navigation stack without animation?[/+]turnipdabeets commentedon May 15, 2017
I'm having the same problem with animations when I reset or navigate backwards more than 1 screen. Here's the StackOverflow question
davidysong commentedon May 17, 2017
I have the same issue also. I am wondering if using a custom Transitioner would allow resetting the stack without any animations: https://reactnavigation.org/docs/views/transitioner
aqnaruto commentedon May 17, 2017
@diegorodriguesvieira hey, you need not to jump to another page, just use header null , and setstate in one page render different component
LaurensLang commentedon May 17, 2017
@diegorodriguesvieira i don't understand?
diegorodriguesvieira commentedon May 17, 2017
@aqnaruto but if I just navigate to a page without a header, I'll still have the navigation stack with the items because it has not been reset, can I have performance issues with that?
diegorodriguesvieira commentedon May 17, 2017
@LaurensLang I need to reset to the first navigation page inside the tab, however without seeing the animations for each card in the stack
diegorodriguesvieira commentedon May 17, 2017
@davidysong I will try, thanks
andreecosta commentedon May 18, 2017
+1 anyone with a solution?
sckoh commentedon May 18, 2017
+1
lyubo commentedon May 18, 2017
+1
mnkang89 commentedon May 23, 2017
+1
MSchmidt commentedon May 23, 2017
@diegorodriguesvieira did you figure this out yet? What you are trying to accomplish is basically default iOS behaviour and should work out of the box ideally.
faceyspacey commentedon May 24, 2017
Here's a concise proposal that will fix this in many other issues:
#1663
61 remaining items
Fix stack navigator animations (#1493) (#2520)
toandk commentedon Nov 1, 2017
This solution worked for me. Note that if you have 4 screen A, B, C, D and want to back from D to A, you have to call
NavigationActions.back
with key of Bvonovak commentedon Nov 18, 2017
closing since this was fixed by #2520, but feel free to reopen in case the issue persists
eballeste commentedon Dec 9, 2017
@vonovak #2520 does not work as intended.
After almost giving up on react-navigation I found your example for extending the NavigatorService but it is incomplete, it's missing the return for when there are no nested navigators.
dustturtle commentedon Jan 11, 2018
does this issues solved? In iOS we can simply push viewcontrollers by nav just disable the animation.
pisangGoreng commentedon Jan 19, 2018
dustturtle commentedon Jan 25, 2018
welcome to RNRF, easy case for that~
luqmanrom commentedon Feb 2, 2018
How is it solved in RNRF @dustturtle
andidev commentedon Feb 18, 2018
@luqmanrom it is not solved there as well. RNRF is based on React Navigation.
see aksonov/react-native-router-flux#2713
brentvatne commentedon Feb 21, 2018
can someone please create a new issue for this and include a link to an example reproducing it on https://snack.expo.io or github? please without any superfluous code. I'd be happy to investigate. thanks!