@react-navigation/core
TypeScript icon, indicating that this package has built-in type declarations

6.4.16 • Public • Published

@react-navigation/core

Core utilities for building navigators independent of the platform.

Installation

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

yarn add @react-navigation/core

Usage

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

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

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

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

export default createNavigatorFactory(StackNavigator);

Package Sidebar

Install

npm i @react-navigation/core

Weekly Downloads

900,416

Version

6.4.16

License

MIT

Unpacked Size

851 kB

Total Files

416

Last publish

Collaborators

  • okwasniewski
  • kacperkapusciak
  • ericvicenti
  • brentvatne
  • satya164
  • osdnk