2

Using react-navigation-stack 1.10.3, resetting StackActions loads the new stack in place without a transition. The same code snippet with react-navigation-stack 2.0.15 adds a platform default transition, which for iOS is SlideFromRightIOS.

How do I replicate the previous behavior on 1.10.X with 2.0.X where there is no transition while the stack gets reset?

navigation.dispatch(
    StackActions.reset({
        index: 0,
        actions: [
            NavigationActions.navigate({
                routeName: user ? 'Home' : 'Landing',
            }),
        ],
    }),
);
patdugan
  • 787
  • 2
  • 7
  • 17

1 Answers1

7

You can disable animation for these screens by adding animationEnabled: false in the navigationOptions of your Home and Landing screens.

Home.navigationOptions = {
  animationEnabled: false
}
satya164
  • 9,464
  • 2
  • 31
  • 42