React 19+ · Function
useFormState
useFormState connects a form action to state. It returns the latest action result and a new action to use on the form.
Last updated
Syntax
const [state, formAction] = useFormState(action, initialState, permalink?);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
useFormStatusreact-domServer ActionsformAction