Package Exports
- @react-navigation/routers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-navigation/routers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@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/routersUsage
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);