action() — ui Function Reference
Architecture documentation for the action() function in notes.new.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 7fc16759_bc33_a3ac_27fb_c1631bc443d0["action()"] 2f3ed508_f176_75d1_4058_09e604e2f1cb["notes.new.tsx"] 7fc16759_bc33_a3ac_27fb_c1631bc443d0 -->|defined in| 2f3ed508_f176_75d1_4058_09e604e2f1cb style 7fc16759_bc33_a3ac_27fb_c1631bc443d0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.new.tsx lines 9–33
export const action = async ({ request }: ActionFunctionArgs) => {
const userId = await requireUserId(request);
const formData = await request.formData();
const title = formData.get("title");
const body = formData.get("body");
if (typeof title !== "string" || title.length === 0) {
return json(
{ errors: { body: null, title: "Title is required" } },
{ status: 400 },
);
}
if (typeof body !== "string" || body.length === 0) {
return json(
{ errors: { body: "Body is required", title: null } },
{ status: 400 },
);
}
const note = await createNote({ body, title, userId });
return redirect(`/notes/${note.id}`);
};
Domain
Subdomains
Source
Frequently Asked Questions
What does action() do?
action() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.new.tsx.
Where is action() defined?
action() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.new.tsx at line 9.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free