react-navigation-switch-transitioner icon indicating copy to clipboard operation
react-navigation-switch-transitioner copied to clipboard

No animation when transitioning between nested navigators

Open LuisRodriguezLD opened this issue 6 years ago • 5 comments

Hello.

I managed to make it work using this fork.

But I have two pages which are not transitions smoothly, I believe the reason is because those pages have a stacknavigator on their own.

Any workaround? Maybe I am doing something wrong. Here is small example.

const AppNavigator = createSwitchNavigator({
	Loading: withTransition(FadeTransition)(loading), // page
	Welcome: withTransition(FadeTransition)(welcome), // page
	LoggedOut: withTransition(FadeTransition)(loggedout), // nav
	LoggedIn: withTransition(FadeTransition)(loggedin), // nav
});

this is how a nav looks

const Navigator = createBottomTabNavigator({
	Home: home,
        ...
})

LuisRodriguezLD avatar Feb 24 '19 00:02 LuisRodriguezLD

Yes, this has been an issue since the beginning. I fixed some cases in version 0.1.1, and it'll work if you don't wrap the nested navigator in the withTransition HOC. However, there is a caveat: it'll only work when transitioning from/to a wrapped screen, in your case it'll work if you transition from loading to loggedIn, or from welcome to loggedIn. It won't work if you transition between loggedOut and LoggedIn.

elyalvarado avatar Feb 25 '19 12:02 elyalvarado

You are correct. It works precisely as you described. Do you know a workaround this issue?

LuisRodriguezLD avatar Feb 25 '19 15:02 LuisRodriguezLD

not yet, the only workaround is what is currently implemented

elyalvarado avatar Feb 25 '19 16:02 elyalvarado

same here!

JeanMonteiro avatar Mar 05 '19 14:03 JeanMonteiro

same.

mahdinba97 avatar Mar 21 '19 04:03 mahdinba97