Skip to content

Back navigation with custom animations #30

@bataevvlad

Description

@bataevvlad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions