NextPlayground

useFormStatus

The useFormStatus hook lets a component read the submission status of the <form> it is rendered inside — without threading a pending prop through the tree. It must be called from a component nested within the form, not the one that renders the form. Below, both the submit button and the textarea subscribe to the same form's status independently: the button shows a spinner and the field greys out while the server action runs.

react.dev/reference/react-dom/hooks/useFormStatus

Both the button and the textarea read the form's pending state through useFormStatus() — no props are passed down to coordinate them.

useFormStatus Demo