main
Branches
main (6.4.1)dev
Versions
6.4.1v4/5.xv3.x
NativeRouter

<NativeRouter>

Type declaration
declare function NativeRouter(
  props: NativeRouterProps
): React.ReactElement;

interface NativeRouterProps extends MemoryRouterProps {}

<NativeRouter> is the recommended interface for running React Router in a React Native app.

  • <NativeRouter initialEntries> defaults to ["/"] (a single entry at the root / URL)
  • <NativeRouter initialIndex> defaults to the last index of initialEntries
import * as React from "react";
import { NativeRouter } from "react-router-native";

function App() {
  return (
    <NativeRouter>
      {/* The rest of your app goes here */}
    </NativeRouter>
  );
}
Docs and examples CC 4.0
Edit