How to use the @react-navigation/core.createNavigator function in @react-navigation/core

To help you get started, we’ve selected a few @react-navigation/core 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 kmagiera / react-native-screens / createNativeStackNavigator.js View on Github external
function createStackNavigator(routeConfigMap, stackConfig = {}) {
  const router = StackRouter(routeConfigMap, stackConfig);

  // Create a navigator with StackView as the view
  let Navigator = createNavigator(StackView, router, stackConfig);
  // if (!stackConfig.disableKeyboardHandling) {
  //   Navigator = createKeyboardAwareNavigator(Navigator, stackConfig);
  // }

  return Navigator;
}
github keybase / client / shared / settings / routes.desktop.tsx View on Github external
const Settings = require('./').default
    return (
      
        
          
        
      
    )
  }
}
const SettingsSubNavigator = createNavigator(
  SettingsSubNav,
  StackRouter(Shim.shim(settingsSubRoutes), {initialRouteName: Constants.accountTab}),
  {}
)

SettingsSubNavigator.navigationOptions = {
  title: 'Settings',
}

export const newRoutes = {
  // MUST use screen and not getScreen for subnavs!
  settingsRoot: {screen: SettingsSubNavigator},
}
export const newModalRoutes = {
  [Constants.logOutTab]: {getScreen: (): typeof LogOutTab => require('./logout/container').default},
  // TODO connect broken
github keybase / client / shared / router-v2 / router.desktop.js View on Github external
return (
      
        
        
          {scene}
          <header> childNav.pop()} allowBack={index !== 0} /&gt;
        
      
    )
  }
}
const MainNavigator = createNavigator(
  AppView,
  StackRouter(Shim.shim(routes), {initialRouteName: 'tabs.peopleTab'}),
  {}
)

class ModalView extends React.PureComponent {
  render() {
    const navigation = this.props.navigation
    const index = navigation.state.index
    const activeKey = navigation.state.routes[index].key
    const descriptor = this.props.descriptors[activeKey]
    const childNav = descriptor.navigation

    // We render the app below us
    const appKey = this.props.navigation.state.routes[0].key
    const appNav = this.props.navigation.getChildNavigation(appKey)</header>
github kmagiera / react-native-screens / Example / nativeNavigation / createStackNavigator.js View on Github external
function createStackNavigator(routeConfigMap, stackConfig = {}) {
  const router = StackRouter(routeConfigMap, stackConfig);

  // Create a navigator with StackView as the view
  let Navigator = createNavigator(StackView, router, stackConfig);
  if (!stackConfig.disableKeyboardHandling) {
    Navigator = createKeyboardAwareNavigator(Navigator, stackConfig);
  }

  return Navigator;
}
github react-navigation / create-react-app-example / src / App.js View on Github external
About Brent
          
        
        <div>
          
        </div>
      
    );
  }
}

const AppNavigator = createNavigator(
  SidebarView,
  SwitchRouter({
    Home,
    About,
    Profile
  }),
  {}
);

const App = createBrowserApp(AppNavigator);

export default App;
github keybase / client / shared / router-v2 / router.desktop.tsx View on Github external
component={descriptor.getComponent()}
        screenProps={this.props.screenProps || noScreenProps}
      /&gt;
    )
    return (
      
        
        {sceneView}
      
    )
  }
}

const tabs = Shared.desktopTabs

const TabNavigator = createNavigator(
  TabView,
  SwitchRouter(
    tabs.reduce((map, tab) =&gt; {
      map[tab] = createNavigator(
        AppView,
        StackRouter(Shim.shim(routes), {
          initialRouteName: tabRoots[tab],
          initialRouteParams: undefined,
        }),
        {}
      )
      return map
    }, {}),
    {backBehavior: 'none', resetOnBlur: false}
  ),
  {}
github keybase / client / shared / wallets / routes.tsx View on Github external
return (
      
        
          
        
      
    )
  }
}

const WalletsSubNavigator = createNavigator(
  WalletsSubNav,
  StackRouter(Shim.shim(walletsSubRoutes), {initialRouteName: 'wallet'}),
  {}
)
const OnboardingOrWalletsNavigator = createSwitchNavigator(
  {
    onboarding: RoutedOnboarding,
    walletsubnav: WalletsSubNavigator,
  },
  {initialRouteName: 'onboarding'}
)

type OnboardingOrWalletsProps = NavigationViewProps &amp; {acceptedDisclaimer: boolean}

class _OnboardingOrWallets extends React.Component {
  static router = OnboardingOrWalletsNavigator.router
github keybase / client / shared / router-v2 / router.desktop.js View on Github external
)}
        
      
    )
  }
}

const LoggedInStackNavigator = createNavigator(
  ModalView,
  StackRouter(
    {
      Main: {screen: MainNavigator},
      ...Shim.shim(modalRoutes),
    },
    {}
  ),
  {}
)

const LoggedOutStackNavigator = createNavigator(
  AppView,
  StackRouter(
    {...Shim.shim(loggedOutRoutes)},
    {
github react-navigation / experimental-transitioner / example / src / examples / CardStack.js View on Github external
<button> navigation.push('HomeScreen')}
            title="Go Home"
          /&gt;
          </button><button> navigation.goBack()} title="Go Back" /&gt;
        
      
    );
  }
}

const App = createNavigator(
  Transitioner,
  StackRouter({
    HomeScreen,
    ProfileScreen,
  }),
  {}
);

export default App;
</button>
github keybase / client / shared / router-v2 / router.desktop.tsx View on Github external
tabs.reduce((map, tab) => {
      map[tab] = createNavigator(
        AppView,
        StackRouter(Shim.shim(routes), {
          initialRouteName: tabRoots[tab],
          initialRouteParams: undefined,
        }),
        {}
      )
      return map
    }, {}),
    {backBehavior: 'none', resetOnBlur: false}