Viewing docs for an older release. View latest
useLoaderData

useLoaderData

Returns the serialized data from the closest route loader.

import { useLoaderData } from "@remix-run/react";

export async function loader() {
  return fakeDb.invoices.findAll();
}

export default function Invoices() {
  const invoices = useLoaderData<typeof loader>();
  // ...
}

Additional Resources

Discussions

API

Docs and examples licensed under MIT