@cyrene/router
v1.0.0-beta.2
Published
Client-side router for Cyrene with loaders, actions, and nested routes
Maintainers
Readme
@cyrene/router
Client-side routing for Cyrene — path matching,
nested routes, loaders, and actions. For the DOM components (<Link>,
<NavLink>, <Form>, useNavigate) see
@cyrene/router-dom.
npm install @cyrene/router@betaimport { createRouter } from "@cyrene/router";
const router = createRouter({
routes: [
{ path: "/", component: Home },
{ path: "/users/:id", component: User, loader: ({ params }) => fetchUser(params.id) },
],
});Named params, wildcards, and interleaved patterns (/:a/*/:b) all resolve in a
single left-to-right pass. Loaders run before the route renders; actions handle
mutations.
Docs: https://www.cyrenejs.com · MIT licensed.
