October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

React 19 Actions: What an Action Is and How Three Hooks Work Together

A React 19 Action is a function in a state-changing workflow. See how three hooks handle its result, parent-form status, and optimistic UI.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In React 19, an Action is a function used in a data-changing workflow—such as saving a form—that React can coordinate with transitions and form features. The term matters because useActionState, useFormStatus, and useOptimistic address different parts of that workflow: action results, form submission status, and temporary optimistic UI.

What is an Action in React 19?

The React Team describes a common application workflow as “a data mutation and then update state in response.” An Action is a function used for that kind of state-changing work. React can integrate Actions with transitions and form actions, making it easier to represent pending work and show an optimistic result while an operation is underway. React 19 release announcement

As an Amazon Associate I earn from qualifying purchases.

React 19 supports passing functions to form-related action and formAction props. When a form Action succeeds, React resets uncontrolled form controls. The three hooks discussed here help with common surrounding needs, but they are not three competing ways to submit a form.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the three hooks differ

Hook What it represents Where its value comes from How long it matters
useActionState State returned by an Action, plus whether that Action is pending The hook’s Action, which receives the previous state and submitted payload The returned action state and the Action’s pending lifecycle
useFormStatus Submission status for a form, including pending and submitted data The parent <form> of the component calling the hook The form submission lifecycle
useOptimistic A temporary expected state shown while work is underway A supplied base state and optimistic setter; an optional reducer can calculate updates The optimistic interval while the Action is in progress

What each hook does

useActionState: track an Action’s returned state

Use useActionState when the component needs to keep and render the state returned by an Action. It provides the current state, a dispatcher for the Action, and an isPending flag. The Action receives the previous state and the submitted payload, so it can calculate the next state from both.

This is more than a form-status hook: its state represents the Action’s result, and its pending flag belongs to that Action. When using a Server Function, the hook can also take an optional permalink for progressive enhancement. React: useActionState

useFormStatus: read the parent form’s submission status

Use useFormStatus when a component inside a form needs that form’s submission information. It returns status that includes pending and submitted data. The hook reads the parent form, so call it in a component rendered inside the form whose status it should report.

This placement is useful for a reusable submit button or another nested design-system component: it can respond to the containing form without requiring status to be passed down through props. React: useFormStatus

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

useOptimistic: display a temporary expected state

Use useOptimistic when the interface should respond immediately with an expected result while an Action runs—for example, showing a change before the underlying operation has settled. Call its setter within an Action. React can return the UI to the base state when the operation settles; a reducer can calculate optimistic state as the base changes.

The hook affects what the UI displays temporarily. It does not, by itself, persist a mutation: that remains the responsibility of the underlying operation. React: useOptimistic

How to choose the right hook

  • Choose useActionState when you need to render the state an Action returns or its pending flag.
  • Choose useFormStatus when a descendant of a form needs to know that form’s submission status or submitted data.
  • Choose useOptimistic when you want a temporary UI update while an Action is running, while the underlying operation handles persistence.

These hooks can complement one another because they describe different things: an Action’s result, the parent form’s submission, and a provisional view of state. Select based on which value the component needs and where that value is available.

Server Functions and Server Actions are not interchangeable terms

A Server Function is called a Server Action when it is passed to an action prop or called inside an Action. Not every Server Function is therefore a Server Action; the usage determines the term. React: Server Functions

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Terminology for older React material

The stable React 19 release announcement was published on December 5, 2024. In earlier Canary releases, the API now named useActionState was called useFormState. Use useActionState for current code and terminology; the older name is useful when interpreting material written for those earlier releases. React 19 release announcement

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.