diff --git a/packages/remix-app/app/root.tsx b/packages/remix-app/app/root.tsx index 3af5a65..8d69a9c 100644 --- a/packages/remix-app/app/root.tsx +++ b/packages/remix-app/app/root.tsx @@ -1,6 +1,6 @@ import type { + DataFunctionArgs, LinksFunction, - LoaderFunction, MetaFunction, } from '@remix-run/cloudflare' import { json } from '@remix-run/cloudflare' @@ -24,17 +24,17 @@ export let meta: MetaFunction = () => ({ export let links: LinksFunction = () => [{ rel: 'stylesheet', href: styles }] -export let loader: LoaderFunction = async ({ context }) => { +export let loader = async ({ context }: DataFunctionArgs) => { let id = context.env.COUNTER.idFromName('root') let object = context.env.COUNTER.get(id) let doResponse = await object.fetch('https://../increment') let count = Number(await doResponse.text()) - return json({ count }) + return json({ count }) } export default function App() { - let loaderData = useLoaderData() + let loaderData = useLoaderData() return ( @@ -52,7 +52,3 @@ export default function App() { ) } - -type LoaderData = { - count: number -}