UndieGravity LogoUndiegravity

React 19 and 19.2 Features Every Developer Should Know

Actions, useActionState, useOptimistic, the use API, ref as a prop, metadata tags, Activity, and useEffectEvent: the React 19 features you will actually use.

By UndieGravity, , 2 min read

React 19 removed a lot of boilerplate around forms, loading states, and refs, and React 19.2 (released October 1, 2025) added two long-requested tools. Here is each feature with the problem it solves.

Actions: async functions that handle pending state

Pass an async function to a form's action prop and React tracks the pending state, resets the form on success, and works with the hooks below. No more isLoading state for every form.

useActionState

"use client";
import { useActionState } from "react";

async function subscribe(_prev: string | null, formData: FormData) {
  const email = formData.get("email");
  const res = await fetch("/api/subscribe", { method: "POST", body: JSON.stringify({ email }) });
  return res.ok ? "Thanks for subscribing" : "Something went wrong";
}

export function Subscribe() {
  const [message, formAction, isPending] = useActionState(subscribe, null);
  return (
    <form action={formAction}>
      <input name="email" type="email" required />
      <button disabled={isPending}>{isPending ? "Sending" : "Subscribe"}</button>
      {message && <p>{message}</p>}
    </form>
  );
}

Related: useFormStatus from react-dom lets a nested component, such as a shared submit button, read whether its parent form is pending.

useOptimistic

Show the result of an action before the server confirms it, for example a new comment appearing instantly. If the action fails, React rolls back to the real state.

The use API

use reads a promise or a context. Unlike other hooks it can be called inside conditions. With a promise it suspends until the value is ready, so it pairs with <Suspense>.

ref is a normal prop

Function components receive ref as a prop, so forwardRef is no longer needed for new code.

function Input({ ref, ...props }: React.ComponentProps<"input">) {
  return <input ref={ref} {...props} />;
}

Title and meta tags from any component

Render <title> or <meta> anywhere and React moves them into the document head. In Next.js, keep using the Metadata API; this is most useful in plain React apps.

React 19.2: Activity

<Activity mode="hidden"> hides part of the UI while keeping its state, and cleans up its effects while hidden. Use it for tabs or panels where switching back should not lose what the user typed.

React 19.2: useEffectEvent

Some logic inside an effect needs the latest props without making the effect re-run. useEffectEvent wraps that logic. A classic case: a chat connection should reconnect when the room changes, but not when the theme used for a notification changes.

const onConnected = useEffectEvent(() => {
  showNotification("Connected", theme);
});

useEffect(() => {
  const connection = createConnection(roomId);
  connection.on("connected", onConnected);
  connection.connect();
  return () => connection.disconnect();
}, [roomId]);

Next.js 16 ships React 19.2, so every feature here works in a current Next.js project without extra setup.

Keep reading