@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
Works with
- React Router
- React Aria
- React
- TypeScript
Install
pnpm add @adrienlcp/react-routerExports
Grouped by the section of the documentation that explains them. A row leads to its section.
ignoreSupersededNavigation1 export
Documented in the source only1 export
Documentation
The README and the documents beside it, as written in the repository.
OverviewREADME.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-routerAn 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.