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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

useActionState and useFormStatus solve different parts of a React form: use the first when an action’s returned value should become component state, and the second when a component inside a form needs to know whether that form is submitting. You can use both together—one to display the action result and the other to update a nested submit button.

What is the difference between useActionState and useFormStatus?

Hook What it provides Where to call it Use it for
useActionState The latest value returned by an action, a dispatcher, and an isPending flag At the top level of the component or custom hook that owns the action state Showing a validation result, confirmation, updated count, or other action result
useFormStatus The parent form’s pending, submitted data, method, and action In a child component rendered inside the form Showing submission feedback or changing a child control while the form is pending

The hooks are complementary, not interchangeable. useActionState tracks state returned by an action; useFormStatus reports the status and details of a parent form submission. React’s useActionState reference and useFormStatus reference document these separate roles.

How do you use both hooks in a form?

This example returns a message from the action and renders it after submission. A nested submit button reads the parent form’s pending status.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { useActionState } from 'react';
import { useFormStatus } from 'react-dom';

async function saveMessage(previousState, formData) {
  const message = formData.get('message');

  if (!message) {
    return { error: 'Enter a message before submitting.' };
  }

  // Perform the save operation here.
  return { error: null, notice: 'Message saved.' };
}

function SubmitButton() {
  const { pending } = useFormStatus();

  return (
    
  );
}

export default function MessageForm() {
  const [state, formAction, isPending] = useActionState(saveMessage, {
    error: null,
    notice: null,
  });

  return (
    <form action={formAction}>
      <label>
        Message
        <input name="message" />
      </label>
      <SubmitButton />
      {isPending && <p>Saving your message…</p>}
      {state.error && <p role="alert">{state.error}</p>}
      {state.notice && <p>{state.notice}</p>}
    </form>
  );
}

In the rendered JSX, write ordinary JSX tags such as <form> directly; the escaped tags above keep the example’s form markup visible inside a code block. The isPending value comes from the action state hook, while the nested button’s pending value comes from the form it is inside. Choose one indicator or both according to what the interface needs.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

How does useActionState work?

The current React reference gives the signature useActionState(action, initialState, permalink?). Call it at the top level of a component or custom hook. It returns exactly three values: the current state, a dispatcher for the action, and an isPending flag. See the official API reference for details.

The initial state is used before the action has produced a result. When the action completes, its returned value becomes the next state. When you pass the dispatcher to a form’s action prop, the form submission is handled as a Transition.

Remember the extra first argument

Wrapping an action with useActionState changes its signature: the action receives the previous state first, followed by its usual payload. For a form action, the second argument is the submitted FormData. Omitting the first parameter or treating the first one as form data can make code read the wrong value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
async function submit(previousState, formData) {
  const email = formData.get('email');
  return { email, message: 'Received' };
}

Return expected failures; throw unexpected ones

For a known validation problem, return structured information as state and render it in the form. For an unexpected error, React’s reference describes throwing so the nearest Error Boundary can handle it. Keeping expected user-correctable outcomes in state makes them available to the same UI that displays successful results.

Understand queued actions

useActionState queues calls so each action receives the result of the previous call. A sequence of asynchronous operations can therefore take longer when several submissions are queued. React suggests considering useOptimistic or, in more complex cases, cancelling queued actions or not using useActionState.

Cancellation is not a rollback mechanism: stopping client-side work does not undo a server-side mutation that has already happened. Only cancel when the side effect can safely be ignored or retried.

Rank #3
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How does useFormStatus work?

Import useFormStatus from react-dom. It takes no arguments and returns an object with four fields:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • pending: whether the parent form is pending.
  • data: the submitted FormData, or null.
  • method: get or post.
  • action: the parent form’s function action reference, or null in the cases specified by the reference.

For example, a child status component can read submitted data while the form is pending:

import { useFormStatus } from 'react-dom';

function SubmissionStatus() {
  const { pending, data } = useFormStatus();

  if (!pending) return null;

  const message = data?.get('message');
  return <p>Submitting: {message}</p>;
}

React states that “The useFormStatus Hook must be called from a component that is rendered inside a <form>.” Read the full reference for the hook’s fields and behavior.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Why is useFormStatus pending always false?

The component calling useFormStatus must be a descendant rendered inside the form being observed. Calling the hook in the same component that creates the <form> does not make it track that form.

Move the hook into a nested submit button or status component, then render that component between the form’s opening and closing tags. Also check that the form uses an action submission that the hook can observe; useFormStatus reports parent-form status, not arbitrary asynchronous work elsewhere in the component.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When should you use one hook or both?

  • Use useActionState when the action returns information the interface must retain and display, such as field errors, a confirmation, or updated data.
  • Use useFormStatus when a nested control or message needs the parent form’s submission status, method, submitted data, or action reference.
  • Use both when the form needs to display its action result and give a nested control immediate submission feedback.
  • If pending status alone is enough, a nested useFormStatus consumer may be sufficient; you do not need action-result state just to show that a form is submitting.

What changes with Server Functions and progressive enhancement?

In a framework that supports React Server Components, a Server Function used with useActionState can return a response that is displayed before hydration completes. This behavior is specific to that Server Function and framework scenario; it is not a blanket guarantee for every client-only form.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

The optional permalink argument supports progressive enhancement on dynamic pages using a Server Function. If someone submits before JavaScript loads, the browser can navigate to the permalink. The destination must render the same form component, action, and permalink for React to pass the state through. Once the form is hydrated, the permalink has no effect. See the React reference for its constraints.

The reviewed official references do not state a minimum React version or a complete framework compatibility matrix. Do not infer either from the hook names or from older naming history. The React 19 RC announcement dated April 25, 2024 records that useActionState was previously named useFormState in Canary; that historical note is not a current minimum-version guarantee.

Which React documentation covers form actions?

React’s form reference explains the form action prop. Its Built-in React DOM Hooks overview covers web-specific hooks, including useFormStatus. Together with the individual hook references, these pages clarify how action results, form status, and form submission fit together.

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

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.