Skip to content

Commit 0b90fc4

Browse files
Update loader argument types for stricter typing
Replaces plain object destructuring for loader functions with LoaderFunctionArgs type in the auth and dashboard modules. This enhances type safety and aligns with best practices for TypeScript in the React-Router environment.
1 parent 1d39ddb commit 0b90fc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/features/auth/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Outlet, redirect } from "react-router";
1+
import { Outlet, redirect, type LoaderFunctionArgs } from "react-router";
22
import { auth } from "~/lib/auth";
33

4-
export async function loader({ request }: { request: Request }) {
4+
export async function loader({ request }: LoaderFunctionArgs) {
55
const session = await auth.api.getSession({
66
headers: request.headers,
77
});

app/features/dashboard/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Outlet, redirect, useOutletContext } from "react-router";
1+
import { Outlet, redirect, useOutletContext, type LoaderFunctionArgs } from "react-router";
22
import { AppSidebar } from "./components/app-sidebar";
33
import {
44
Breadcrumb,
@@ -73,7 +73,7 @@ const navAdmin: NavItem[] = [
7373
},
7474
];
7575

76-
export const loader = async ({ request }: { request: Request }) => {
76+
export const loader = async ({ request }: LoaderFunctionArgs) => {
7777
const session = await auth.api.getSession({
7878
headers: request.headers,
7979
});

0 commit comments

Comments
 (0)