Split errors into two kinds.
Expected errors (validation, "name taken") are return values. The action takes (prevState, formData) and returns { error }; the form's component calls useActionState(action, initialState) and renders state.error. Echo the submitted values back too: React resets uncontrolled fields after the action, so defaultValue={state.name} keeps what the user typed.
Pending state comes from isPending (third item of useActionState) or useFormStatus() in a component inside the form.
Without JavaScript, Next.js renders the form as a real HTML form: method="POST", encType="multipart/form-data", with hidden fields naming the action and carrying the previous state. Submitting does a full-page POST; Next.js runs the action, renders the page with the new state and returns HTML. The error message and the echoed input appear as they would with JS. Pending UI can't: no script runs, so useFormStatus never reports true, and the user sees only the browser's loading indicator.
Unexpected errors are thrown. With JavaScript, the nearest error.js renders; the message is replaced in production, and error.digest matches the server log. Without JavaScript, the response was a bare 500 Internal Server Error page.
I ran the form below on Next.js 16.4.5 (next start, React 19.3.0) with JavaScript on and off in Chrome 156 and Firefox 159; both behaved the same. With JS: one POST with a Next-Action header returning text/x-component; without: one POST without it, returning text/html.
The hooks themselves are React's; see the useActionState and Actions questions.