Returns the data from the closest route loader or client loader.
import { useLoaderData } from "react-router"export async function loader() { return await fakeDb.invoices.findAll();}export default function Invoices() { let invoices = useLoaderData<typeof loader>(); // ...} Copy
import { useLoaderData } from "react-router"export async function loader() { return await fakeDb.invoices.findAll();}export default function Invoices() { let invoices = useLoaderData<typeof loader>(); // ...}
Returns the data from the closest route loader or client loader.