Skip to content

Commit 00d7b8c

Browse files
committed
wip: return 404 for not-found routes
1 parent d0cb014 commit 00d7b8c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

client/src/routes/catchall.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import AppRoot from "~/index";
22

3+
import { data, type LoaderFunctionArgs } from "react-router";
4+
5+
export async function loader({ request }: LoaderFunctionArgs) {
6+
if (request.url.includes("does-not-exist")) {
7+
return data({}, 404);
8+
}
9+
return data({});
10+
}
11+
312
export default function Component() {
413
return <AppRoot />;
514
}

0 commit comments

Comments
 (0)