react-navigation-transitions
react-navigation-transitions copied to clipboard
Back navigation with custom animations
When we add fadeIn animation to our stackNavigator for several screens, sometime we have issue that our animation applied in both ways of navigating. We solved it by adding isActive.
// Custom transitions go there
if (prevScene
&& prevScene.route.routeName === 'ScreenA'
&& nextScene.route.routeName === 'ScreenB'
&& nextScene.isActive) {
return fadeIn();
}
return null;
}
I hope this solution will help those who want to use navigation only in one direction.