What useFormStatus Does
useFormStatus() (imported from react-dom) reads the status of the nearest parent <form> from within a child component — with no props needed at all. It only works for a component rendered inside a form, reading that form’s live submission status.
useFormStatus Return Value
| Property | Meaning |
|---|---|
| pending | true while the parent form’s action is in flight |
| data | The FormData currently being submitted |
| method | The HTTP method used for the submission ("get" or "post") |
| action | A reference to the action function the parent form is using |
Must Be Called from a Component Inside the form
useFormStatus only returns meaningful status when called from a component rendered as a descendant of a <form> — calling it in the same component that renders the <form> itself always returns the default, non-pending status, since a form cannot read its own status through this hook.
A Common Mistake
function ProfileForm({ updateProfile }) {
const { pending } = useFormStatus(); // Wrong: always returns pending: false here
return (
<form action={updateProfile}>
<button disabled={pending}>Save</button>
</form>
);
}
// Fix: move the useFormStatus call into a child component rendered inside the <form>Why This Avoids Prop Drilling
Without useFormStatus, showing a pending state on a deeply nested submit button would require passing an isPending prop down manually. useFormStatus reads it directly from the surrounding form context instead, keeping the submit button fully self-contained and reusable across different forms.
Best Practice
Use useFormStatus specifically inside small, reusable components meant to live within a form (submit buttons, inline validation messages) — for the top-level component that renders the form itself, useActionState is usually the better fit for tracking pending/result state.