Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions playground/framework-spa/app/modules/transactions/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { type RouteConfig, route } from "@react-router/dev/routes";

export default [
route("transactions", "./routes/home.tsx"),
] satisfies RouteConfig;
10 changes: 10 additions & 0 deletions playground/framework-spa/app/modules/transactions/routes/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { href, Link } from "react-router";

export default function TransactionHomePage() {
return (
<div>
<h1>Transactions Home page</h1>
<Link to={href("/")}>Root Route</Link>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { type RouteConfig, route } from "@react-router/dev/routes";

export default [
route("user-management", "./routes/home.tsx"),
] satisfies RouteConfig;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { href, Link } from "react-router";

export default function UserManagementHomePage() {
return (
<div>
<h1>User Management Home page</h1>
<Link to={href("/")}>Root Route</Link>
</div>
);
}
9 changes: 8 additions & 1 deletion playground/framework-spa/app/routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import { type RouteConfig, index } from "@react-router/dev/routes";

export default [index("routes/_index.tsx")] satisfies RouteConfig;
import transactionRoutes from "~/modules/transactions/routes";
import userManagementRoutes from "~/modules/user-management/routes";

export default [
index("routes/_index.tsx"),
...transactionRoutes,
...userManagementRoutes,
] satisfies RouteConfig;
3 changes: 2 additions & 1 deletion playground/framework-spa/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MetaFunction } from "react-router";
import { href, Link, type MetaFunction } from "react-router";

export const meta: MetaFunction = () => {
return [
Expand All @@ -11,6 +11,7 @@ export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<h1>Welcome to React Router</h1>
<Link to={href("/transaction")}>Transactions Dashboard</Link>
</div>
);
}
Loading