Home / Function/ loader() — ui Function Reference

loader() — ui Function Reference

Architecture documentation for the loader() function in notes.$noteId.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  5607c9f3_3b1b_9457_55f0_8c4b1c9dd1c4["loader()"]
  c50c71cf_2f76_a310_0a77_25e34e7779ce["notes.$noteId.tsx"]
  5607c9f3_3b1b_9457_55f0_8c4b1c9dd1c4 -->|defined in| c50c71cf_2f76_a310_0a77_25e34e7779ce
  style 5607c9f3_3b1b_9457_55f0_8c4b1c9dd1c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.$noteId.tsx lines 14–23

export const loader = async ({ params, request }: LoaderFunctionArgs) => {
  const userId = await requireUserId(request);
  invariant(params.noteId, "noteId not found");

  const note = await getNote({ id: params.noteId, userId });
  if (!note) {
    throw new Response("Not Found", { status: 404 });
  }
  return json({ note });
};

Subdomains

Frequently Asked Questions

What does loader() do?
loader() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.$noteId.tsx.
Where is loader() defined?
loader() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.$noteId.tsx at line 14.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free