How to use react-native-navigation - 10 common examples

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 flow-typed / flow-typed / definitions / npm / react-native-navigation_v3.x.x / flow_v0.104.x- / test_react-native-navigation.js View on Github external
it('raises an error when call without options', () => {
      // $ExpectError - first argument required
      Navigation.setDefaultOptions();
    });
  });
github flow-typed / flow-typed / definitions / npm / react-native-navigation_v3.x.x / flow_v0.104.x- / test_react-native-navigation.js View on Github external
it('should raises an error when cast to wrong type', () => {
    Navigation.constants().then(result => {
      // $ExpectError - backButtonId is string
      (result.backButtonId: boolean);
      // $ExpectError - backButtonId is number
      (result.bottomTabsHeight: string);
      // $ExpectError - backButtonId is number
      (result.statusBarHeight: string);
      // $ExpectError - backButtonId is number
      (result.topBarHeight: string);
    });
  });
});
github jcalderaio / react-native-honors-app / src / App.js View on Github external
];

/*
  if (Platform.OS === 'android') {
    tabs.push({
      label: 'Collapsing',
      screen: 'example.CollapsingTopBarScreen',
      icon: require('../img/one.png'),
      title: 'Collapsing',
    });
  }
  */
  return tabs;
};
// this will start our app
Navigation.startTabBasedApp({
  tabs: createTabs()
});


/*
import React, { Component } from 'react';
import { LoginButton, AccessToken, GraphRequest, GraphRequestManager } from 'react-native-fbsdk';
import { View, Text } from 'react-native';
import { Header, styles } from './components/common'; // Actually importing from ./components/common/index.js, but index is automattic

const user = [];

class Login extends Component {

  test() {
    console.log('Name: ', user.name);
github saitoxu / InstaClone / src / app.js View on Github external
)

const SendButton = () => (
   console.log('pressed me!')}
  >
    
  
)

// Register the component
Navigation.registerComponent('CameraButton', () => CameraButton);
Navigation.registerComponent('SendButton', () => SendButton);

export default class App {
  constructor() {
    iconsLoaded.then(() => {
      // personIcon = iconsMap['ios-person']
      // homeIcon = iconsMap['ios-home']
      icons = iconsMap
      this.startApp();
    });
  }

  // start the app
  startApp() {
    Navigation.startTabBasedApp({
      tabs: [{
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 d14na / zeronet-explorer / src / frames / Camera.js View on Github external
_close() {
        /* Close the webview. */
        Navigation.popToRoot('zeronet.Main').catch(console.log);
    }
github d14na / zeronet-explorer / src / frames / Stage.js View on Github external
_closeZite() {
        /* Close the webview. */
        Navigation.popTo('zeronet.Main').catch(console.log);

        /* Close the stage. */
        this.closeStage();
    }
github d14na / zeronet-explorer / src / frames / Webview.js View on Github external
_btnBack() {
        console.log('pressed Webview back button');

        // /* Close the webview. */
        Navigation.popTo('zeronet.Main').catch(console.log);
    }
github d14na / zeronet-explorer / src / frames / Startup.js View on Github external
_initZite(_target, _path) {
        // FIXME If the tag is NOT an address then we need to do a
        //       ZeroName lookup to retrieve the address
        const address = _target;

        // FIXME Handle the path
        // const path = _path;

        /* Set the zite address. */
        stores.Stage.initZite(address);

        /* Open the stage window. */
        Navigation.mergeOptions('zeronet.Stage', {
            sideMenu: {
                left: {
                    visible: true,
                },
            },
        });
    }
}
github ruddell / ignite-jhipster / boilerplate / app / navigation / layouts.js View on Github external
export function registerScreensAndStartApp () {
  Navigation.registerComponentWithRedux(LOGIN_SCREEN, () => LoginScreen, Provider, store)
  Navigation.registerComponentWithRedux(REGISTER_SCREEN, () => RegisterScreen, Provider, store)
  Navigation.registerComponentWithRedux(FORGOT_PASSWORD_SCREEN, () => ForgotPasswordScreen, Provider, store)
  Navigation.registerComponentWithRedux(CHANGE_PASSWORD_SCREEN, () => ChangePasswordScreen, Provider, store)
  Navigation.registerComponentWithRedux(SETTINGS_SCREEN, () => SettingsScreen, Provider, store)
  Navigation.registerComponentWithRedux(DRAWER_CONTENT, () => DrawerContent, Provider, store)
  Navigation.registerComponentWithRedux(LAUNCH_SCREEN, () => LaunchScreen, Provider, store)
  Navigation.registerComponentWithRedux(ENTITIES_SCREEN, () => EntitiesScreen, Provider, store)
  // ignite-jhipster-navigation-registration-needle

  Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setDefaultOptions({
      topBar: {
        topBar: {
          title: {
            color: Colors.snow
          }
        },
        backButton: {
          showTitle: false,
          testID: 'backButton',
          icon: Images.chevronLeftIcon,
          color: Colors.snow,
          iconColor: Colors.snow