9 lines
236 B
TypeScript
9 lines
236 B
TypeScript
import { useTypedRouteLoaderData } from "remix-typedjson";
|
|
import type { loader } from "../root";
|
|
|
|
export function useApiOrigin() {
|
|
const routeMatch = useTypedRouteLoaderData<typeof loader>("root");
|
|
|
|
return routeMatch!.apiOrigin;
|
|
}
|