All topics
Advancedadvanced

React 19 Actions and Form Status Hooks

Learn how React 19's Actions, useActionState, and useFormStatus streamline handling async form submissions and pending states.

React 19 introduced Actions — async functions that can be passed directly to a <form>'s action prop (or used with useTransition) — which React automatically manages the pending state, errors, and optimistic updates for, without hand-wiring isSubmitting flags and try/catch blocks around every form submission handler yourself. Passing an async function directly as a form's action lets React intercept the native form submission and treat it as a transition-managed asynchronous operation.

React 19 Actions are like a hotel's automated room-service tracking system: instead of every individual staff member manually radioing in 'order placed,' 'order in progress,' 'order delivered' for each request (hand-rolled state), the system itself tracks an order's status end to end, and any staff member (a nested child component) can simply check the system's current status without needing someone to have explicitly told them.

Key Concepts

1
useActionState(actionFn, initialState) wraps an action function and returns the current state (whatever the action last returned, like a validation error or success result), a wrapped action to actually invoke, and a pending boolean — consolidating what previously required several separate useState calls (for the result, an error, and a loading flag) plus manual async handling into one cohesive hook purpose-built for this exact pattern.
useActionState(actionFn, initialState)useState
2
useFormStatus() is a companion hook that lets a nested child component (like a submit button) read the pending status of its nearest parent <form> without that status needing to be threaded down as an explicit prop — the child calls useFormStatus() directly and automatically knows if the enclosing form's action is currently pending, which is particularly useful for building a reusable <SubmitButton> component that shows a loading state for whatever form happens to contain it.
useFormStatus()<form><SubmitButton>
3
Interviewers exploring the newest React APIs ask candidates to rewrite a traditional hand-rolled 'submit with loading state and error handling' form using useActionState and useFormStatus, expecting them to recognize the reduction in boilerplate and the specific advantage of useFormStatus letting a deeply nested child component (rather than only the form's direct owner) access pending state without prop drilling.
useActionStateuseFormStatus