Add catch-all 404 route and NotFound component to frontend routing
Some checks failed
Test / verify-generated-code (pull_request) Successful in 49s
Test / test (pull_request) Failing after 1m10s
Test / test-frontend (pull_request) Successful in 23s
Test / lint (pull_request) Failing after 1m8s

This commit is contained in:
GW_MC
2025-12-02 19:51:49 +08:00
parent 051951dc44
commit 06cabb0e18
2 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,7 @@
import { type RouteConfig, index } from "@react-router/dev/routes"; import { type RouteConfig, index, route } from '@react-router/dev/routes';
export default [index("routes/home.tsx")] satisfies RouteConfig; export default [
index('routes/home.tsx'),
// catch-all 404 route
route('*', 'routes/404.tsx'),
] satisfies RouteConfig;

View File

@@ -0,0 +1,3 @@
export default function NotFound() {
return <h1>404 - Not Found</h1>;
}