mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-09 11:28:16 -05:00
11 lines
263 B
TypeScript
11 lines
263 B
TypeScript
import { useMatches } from "@remix-run/react";
|
|
import invariant from "tiny-invariant";
|
|
import type { RootLoaderData } from "~/root";
|
|
|
|
export function useRootLoaderData() {
|
|
const [root] = useMatches();
|
|
invariant(root);
|
|
|
|
return root.data as RootLoaderData;
|
|
}
|