Files
react-navigation/packages/routers
Michal Osadnik 3703ab6353 chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.4
 - @react-navigation/core@5.0.0-alpha.3
 - @react-navigation/drawer@5.0.0-alpha.4
 - @react-navigation/example@5.0.0-alpha.2
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.4
 - @react-navigation/material-top-tabs@5.0.0-alpha.4
 - @react-navigation/native@5.0.0-alpha.3
 - @react-navigation/routers@5.0.0-alpha.4
 - @react-navigation/stack@5.0.0-alpha.5
2019-08-27 11:06:59 +01:00
..
2019-08-27 11:06:59 +01:00
2019-08-27 11:06:59 +01:00
2019-08-21 19:12:40 +05:30
2019-08-21 14:27:07 +05:30

@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/core @react-navigation/routers

Usage

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

import { useNavigationBuilder } from '@react-navigation/core';
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 createNavigator(StackNavigator);