This package has been deprecated

Author message:

This package is no longer supported. Please use @react-navigation/stack instead. See https://reactnavigation.org/docs/stack-navigator/ for usage guide

react-navigation-animated-switch-navigator

0.1.0 • Public • Published

react-navigation-animated-switch-navigator

This navigator uses the Reanimated Transitions API to animate route change transitions. Aside from the animations, it is identical to the standard switch navigator.

Installation

  • Install react-native-reanimated >= 1.0.0 if you have not already (the alpha version will not work!). If you have a managed Expo project, you need to use >= SDK 33 to have the correct version of Reanimated.
  • Install react-navigation-animated-switch-navigator with your favorite JS package manager.

Usage

const MySwitch = createAnimatedSwitchNavigator({
  Home: HomeScreen,
  Other: OtherScreen,
});

Ta da! When you change between routes the screens will cross-fade with each other. You can customize the transition using the transition prop:

import { Transition } from 'react-native-reanimated';
 
const MySwitch = createAnimatedSwitchNavigator(
  {
    Home: HomeScreen,
    Other: OtherScreen,
  },
  {
    transition: (
      <Transition.Together>
        <Transition.Out
          type="slide-bottom"
          durationMs={400}
          interpolation="easeIn"
        />
        <Transition.In type="fade" durationMs={500} />
      </Transition.Together>
    ),
  }
);

Learn more about the Transition API here.

Readme

Keywords

none

Package Sidebar

Install

npm i react-navigation-animated-switch-navigator

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

3.17 kB

Total Files

3

Last publish

Collaborators

  • brentvatne
  • satya164