react-navigation-transitions icon indicating copy to clipboard operation
react-navigation-transitions copied to clipboard

Back navigation with custom animations

Open bataevvlad opened this issue 5 years ago • 0 comments

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.

bataevvlad avatar Jan 16 '20 10:01 bataevvlad