({ request }: { request: Request })
| 18 | type LoaderData = { toastMessage?: ToastMessage }; |
| 19 | |
| 20 | export async function loader({ request }: { request: Request }) { |
| 21 | const cookie = request.headers.get("cookie"); |
| 22 | const session = await getSession(cookie); |
| 23 | const toastMessage = session.get("toastMessage") as ToastMessage; |
| 24 | |
| 25 | return json( |
| 26 | { toastMessage }, |
| 27 | { |
| 28 | headers: { "Set-Cookie": await commitSession(session) }, |
| 29 | } |
| 30 | ); |
| 31 | } |
| 32 | export default function Index() { |
| 33 | const { toastMessage } = useLoaderData<LoaderData>(); |
| 34 |
nothing calls this directly
no outgoing calls
no test coverage detected