How to use the react-native-navigation.Navigation.setDefaultOptions 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 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 uport-project / uport-mobile / lib / navigators / navigation.ts View on Github external
? {
        id: 'scanButton',
        icon: scanIcon,
        color: 'white',
      }
    : {}
  const defaultProfileEditButton = {
    id: 'edit',
    text: 'Edit',
  }

  /**
   * Some options have not been updated in the nav library so we need to override it :(
   */

  Navigation.setDefaultOptions({
    animations: {
      setRoot: {
        alpha: {
          from: 0,
          to: 1,
          duration: 500,
        },
      },
    },
    layout: {
      backgroundColor: Theme.colors.secondary.background,
    },
    sideMenu: {
      right: {
        enabled: true,
        // @ts-ignore
github uport-project / uport-mobile / lib / navigators / navigation.ts View on Github external
const startOnboarding = async () => {
  Navigation.setDefaultOptions({
    animations: {
      setRoot: {
        alpha: {
          from: 0,
          to: 1,
          duration: 500,
        },
      },
    },
    topBar: {
      drawBehind: true,
      background: {
        color: 'transparent',
      },
      // @ts-ignore
      buttonColor: 'white',
github yusufyildirim / react-native-lightning / index.js View on Github external
Navigation.events().registerAppLaunchedListener(async () => {
  // Default options for all screens
  Navigation.setDefaultOptions({
    topBar: {
      visible: true,
      backButton: {
        color: 'black',
        showTitle: false
      },
      hideBackButtonTitle: true,
      backButtonImage: images.example,
    },
  });

  startFromHome();
});
github RN-ONE / RNFrameWorkNew / index.js View on Github external
Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setDefaultOptions(AppDefaultOptions);

    //先看看是不是登陆了的
    SaveLocalUtil.load(Const.SAVE_LOCAL_LOGINED_USER_DATA, (data: User) => {
        if (data && !CommonUtil.isEmpty(data.userId) && !CommonUtil.isEmpty(data.userName) && !CommonUtil.isEmpty(data.userToken)) {
            //进入主页
            gotoHome(data);
        } else {
            //进入登陆页面
            gotoLogin();
        }
    });

    if (!CommonUtil.isDebug) {
        CheckCodePushUpdateUtil.checkUpdate();
    }
github forest-watcher / forest-watcher / app / main.js View on Github external
async launchRoot() {
    await Navigation.setDefaultOptions({
      ...Theme.navigator.styles
    });

    const state = this.store.getState();
    let screen = 'ForestWatcher.Home';
    if (state.user.loggedIn && state.app.synced) {
      screen = 'ForestWatcher.Dashboard';
    }

    await launchAppRoot(screen);
    await this._handleAppStateChange('active');
  }
github NordicMuseum / Nordic-Museum-Audio-Guide / v2 / src / index.js View on Github external
orientation: ['portrait'],
      direction: isRTL ? 'rtl' : 'ltr',
    },
  };

  if (Platform.OS === 'android') {
    defaultOptions.animations = {
      push: { enabled: 'false' },
      pop: { enabled: 'false' },
      setRoot: { enabled: 'false' },
      showModal: { enabled: 'false' },
      dismissModal: { enabled: 'false' },
    };
  }

  Navigation.setDefaultOptions(defaultOptions);

  const currentAppVersion = await currentAppVersionPromise;
  const newVersion = appVersion == null || appVersion !== currentAppVersion;

  hydrate(newVersion || __DEV__);

  if (newVersion) {
    setAppVersion(currentAppVersion);
  }

  const { setLocale, setRTL } = setI18nConfig(locale);
  const store = configureStore({
    device: { locale: setLocale, isRTL: setRTL, appVersion, museumMode },
  });

  audioActor(store);
github raindropio / mobile / src / modules / navigation / index.js View on Github external
setDefaultOptions(props) {
        return Navigation.setDefaultOptions(props)
    },