Skip to content

@reactra/router

Terminal window
npm install @reactra/router@alpha

The router runtime. Routes come from the file-based src/pages/** tree, compiled into a manifest by @reactra/vite-plugin.

  • configureRouter(options) — register the generated ROUTES and set the history mode. Called once from main.tsx.
  • RouteRenderer — the component that renders whichever route matches the current URL.
  • RouteLink — a declarative navigation link.
  • navigate(to) — programmatic navigation.
import { configureRouter, RouteRenderer } from "@reactra/router"
import { ROUTES } from "./routeManifest.generated"
configureRouter({ mode: "history", routes: ROUTES })