Tous les exports

@adrienlcp/react-router

react-aria links that navigate through react-router: a RouterProvider wired to useNavigate, external URLs left alone, NavigateOptions typed on every link

Fonctionne avec

  • React Router
  • React Aria
  • React
  • TypeScript

Installation

pnpm add @adrienlcp/react-router

Exports

Groupés par la section de la documentation qui les explique. Une ligne mène à sa section.

Documentation

Le README et les documents à côté, tels qu’écrits dans le dépôt.

PrésentationREADME.md

For apps whose links are react-aria-components and whose routes are react-router: the wiring every one of them repeats, kept in one version across them. React 19, react-aria-components and react-router are peers.

pnpm add @adrienlcp/react-router

An external URL left alone: useRouterHrefREADME.md

react-router's useHref resolves every href against the current route, an external URL included: https://example.com would come out as /current/route/https:/example.com. useRouterHref returns an absolute URL untouched and defers to useHref for the rest. AriaRouterProvider already uses it; it is exported for an app that wires RouterProvider itself.

ignoreSupersededNavigationREADME.md

The .catch handler behind the provider, for an app that calls navigate itself: Promise.resolve(navigate(to)).catch(ignoreSupersededNavigation) swallows the AbortError of a superseded navigation and throws anything else again.