Skip to content

Commit 7f91847

Browse files
committed
feat: add route
1 parent a11b66c commit 7f91847

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

frontend/app/login/login.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function Login() {
2+
return (
3+
<div>
4+
<h1>Welcome to the App!</h1>
5+
<p>This is a simple React Router application.</p>
6+
</div>
7+
);
8+
}

frontend/app/routes.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
import { type RouteConfig, index } from "@react-router/dev/routes";
1+
import { type RouteConfig, index, route } from "@react-router/dev/routes";
22

3-
export default [index("routes/home.tsx")] satisfies RouteConfig;
3+
export default [
4+
index("routes/home.tsx"),
5+
route("app/app", "routes/app.tsx"),
6+
] satisfies RouteConfig;

frontend/app/routes/app.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Route } from "./+types/app";
2+
import { Welcome } from "~/welcome/welcome";
3+
4+
export function meta({}: Route.MetaArgs) {
5+
return [
6+
{ title: "New React Router App" },
7+
{ name: "description", content: "Welcome to React Router!" },
8+
];
9+
}
10+
11+
export default function Home() {
12+
return <Welcome />;
13+
}

frontend/app/routes/home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Route } from "./+types/home";
2-
import { Welcome } from "../welcome/welcome";
2+
import { Login } from "~/login/login";
33

44
export function meta({}: Route.MetaArgs) {
55
return [
@@ -9,5 +9,5 @@ export function meta({}: Route.MetaArgs) {
99
}
1010

1111
export default function Home() {
12-
return <Welcome />;
12+
return <Login />;
1313
}

0 commit comments

Comments
 (0)