useActionState is useReducer for side effects: the reducer may be async, talk to a server, and its return value is the new state. It returns [state, dispatch, isPending]; a third argument, permalink, is optional.
action(previousState, payload)receives the last result (initiallyinitialState) and whatever you passed todispatch. As a form action, the payload is theFormData, so the signature is(prevState, formData), not(formData).stateis the latest returned value: a result, an error message, the submitted values to show again.isPendingistruefrom the first dispatch until every queued call has finished and the result is committed.dispatchmust run in a Transition.<form action={dispatch}>andformActiondo that for you; from a click handler, wrap it instartTransition.
Queued, in order. Each call needs the previous result, so React runs dispatches one at a time. Three quick submissions ran back to back, each receiving the previous return value. Use useOptimistic when the user shouldn't wait for the queue, or plain useTransition when calls are independent and may run in parallel.
Errors. A thrown error cancels everything still queued and goes to the nearest error boundary. For expected failures, such as validation, return an error state instead.
permalink only matters with a Server Function on a server-rendered page: if the form is submitted before JavaScript has loaded, the browser goes to that URL, and React passes the state through when the same form renders there. After hydration it does nothing.
useActionState replaces ReactDOM.useFormState from the Canary releases. React 19.3.1 still exports the old name; using it logs a rename error in development.