How to use the react-native-navigation.Navigation.events function in react-native-navigation

To help you get started, we’ve selected a few react-native-navigation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d14na / zeronet-explorer / src / app.android.js View on Github external
// @flow

import { Navigation } from 'react-native-navigation'

import { registerScreens } from './screens'
registerScreens()

/* Silence 'unneeded' yellow box alerts. */
console.ignoredYellowBox = [
    'Remote debugger',
    'Debugger and device times',
    'Warning: componentWillMount is deprecated', // FIXME RN v.0.54.0
    'Warning: componentWillReceiveProps is deprecated', // FIXME RN v.0.54.0
]

Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setDefaultOptions({
        _animations: {
            startApp: {
                y: {
                    from: 1000,
                    to: 0,
                    duration: 500,
                    interpolation: 'accelerate',
                },
                alpha: {
                    from: 0,
                    to: 1,
                    duration: 500,
                    interpolation: 'accelerate'
                }
            },
github mattermost / mattermost-mobile / app / screens / edit_profile / edit_profile.js View on Github external
componentDidMount() {
        this.navigationEventListener = Navigation.events().bindComponent(this);
    }
github mattermost / mattermost-mobile / app / screens / notification / notification.js View on Github external
setDidDisappearListener = () => {
        this.didDismissListener = Navigation.events().registerComponentDidDisappearListener(async ({componentId}) => {
            if (componentId === this.props.componentId && this.tapped) {
                await dismissAllModals();
                await popToRoot();
            }
        });
    }
github birkir / kvikmyndr-app / src / screens / movie / Movie.tsx View on Github external
to: 0,
              duration: 250,
            },
          },
        },
      } : {},
      bottomTabs: {
        translucent: false,
        barStyle: 'black',
        drawBehind: true,
        backgroundColor: '#000000',
      },
    } as Options;
  }

  private events = Navigation.events().bindComponent(this);
  private scrollY = new Animated.Value(0);

  private animatedHeroStyles = {
    transform: [{
      translateY: this.scrollY.interpolate({
        inputRange: [-(BACKDROP_HEIGHT + TOOLBAR_HEIGHT), 0, BACKDROP_HEIGHT],
        outputRange: [-(BACKDROP_HEIGHT + TOOLBAR_HEIGHT) / 2, 0, TOOLBAR_HEIGHT],
      }),
    }, {
      scale: this.scrollY.interpolate({
        extrapolate: 'clamp',
        inputRange: [-(BACKDROP_HEIGHT + TOOLBAR_HEIGHT), 0],
        outputRange: [2.5, 1],
      }),
    }],
  };
github wix / react-native-crash-course / src / posts / screens / ViewPost.js View on Github external
constructor(props) {
    super(props);

    Navigation.events().bindComponent(this);
  }
github hummingbird-me / kitsu-mobile / src / screens / Notifications / NotificationsScreen / index.js View on Github external
constructor(props) {
    super(props);
    Navigation.events().bindComponent(this);
  }
github developer239 / redux-react-native-wix-navigation-v2-with-auth / src / app.ts View on Github external
import { Navigation } from 'react-native-navigation'
import { registerScreens } from './navigation'
import { INITIALIZING_SCREEN } from './modules/Core/screens/Initializing'

registerScreens()

Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
        name: INITIALIZING_SCREEN.name,
      },
    },
  })
})
github brandingbrand / flagship / packages / pirateship / src / lib / ScreenVisibilityListener.ts View on Github external
register(): void {
    this.listener = Navigation.events().registerComponentDidAppearListener(
      ({componentId, componentName}) => {
        if (!__DEV__ && screen && screensToIgnore.indexOf(componentName) === -1) {
          Analytics.screenview(componentName, {
            url: ''
          });
        }
      }
    );
  }
github wix / react-native-navigation / playground / src / screens / CustomTopBar.js View on Github external
constructor(props) {
    super(props);
    this.state = {};
    this.subscription = Navigation.events().bindComponent(this);
  }
github birkir / kvikmyndr-app / src / screens / coming-soon / ComingSoon.tsx View on Github external
icon: require('../../assets/icons/calendar.png'),
        selectedIcon: require('../../assets/icons/calendar-filled.png'),
      },
      layout: {
        backgroundColor: '#000000',
      },
      bottomTabs: {
        translucent: false,
        barStyle: 'black',
        drawBehind: true,
        backgroundColor: '#000000',
      },
    } as Options;
  }

  events = Navigation.events().bindComponent(this);

  state = {
    insets: { top: 0, bottom: 0, calculated: false },
  };

  componentDidMount() {
    Movies.loadNewMovies();

    getInsets(this.props.componentId)
      .then(insets => this.setState({ insets }));
  }

  componentDidAppear() {
    Store.setComponentId(this.props.componentId);
  }