Files
react-navigation/packages/routers
Satyajit Sahoo 536225c2c3 chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.35
 - @react-navigation/compat@5.0.0-alpha.24
 - @react-navigation/core@5.0.0-alpha.33
 - @react-navigation/drawer@5.0.0-alpha.37
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.32
 - @react-navigation/material-top-tabs@5.0.0-alpha.31
 - @react-navigation/native-stack@5.0.0-alpha.25
 - @react-navigation/native@5.0.0-alpha.25
 - @react-navigation/routers@5.0.0-alpha.23
 - @react-navigation/stack@5.0.0-alpha.59
2020-01-13 14:37:49 +01:00
..
2020-01-13 14:37:49 +01:00
2020-01-13 14:37:49 +01:00

@react-navigation/routers

Routers to help build custom navigators.

You probably don't need to use this package directly if you're not building custom navigators.

Installation

Open a Terminal in your project's folder and run,

yarn add @react-navigation/routers

Usage

A basic custom navigator bundling a router and a view looks like this:

import { createNavigatorFactory, useNavigationBuilder } from '@react-navigation/native';
import { StackRouter } from '@react-navigation/routers';

function StackNavigator({ initialRouteName, children, ...rest }) {
  const { state, navigation, descriptors } = useNavigationBuilder(StackRouter, {
    initialRouteName,
    children,
  });

  return (
    <StackView
      state={state}
      navigation={navigation}
      descriptors={descriptors}
      {...rest}
    />
  );
}

export default createNavigatorFactory(StackNavigator);