Renamed in React 19
useFormState from react-dom is gone. Use useActionState from react. The new hook also returns a third value, isPending — you no longer need useFormStatus for the common case of disabling the submit button.
Shape
const [state, formAction, isPending] = useActionState(action, initialState); — render state, pass formAction to the form, disable on isPending.
Action signature
The action receives (prevState, formData) and returns the next state. Whatever it returns becomes state on the next render. This is your channel for "the action ran, here's what happened": success messages, validation errors, optimistic markers.