What's New in React 19? Major Features & Updates You Should Know
React 19 explained with examples: Actions, useActionState, useFormStatus and useOptimistic, the new use API, ref as a prop, document metadata, Server Components, removed APIs and how to upgrade.

TL;DR / Key Takeaway
- React 19 explained with examples: Actions, useActionState, useFormStatus and useOptimistic, the new use API, ref as a prop, document metadata, Server Components, removed APIs and how to upgrade.
React 19 became stable in December 2024. Its biggest changes are Actions for handling forms and async updates, new hooks (useActionState, useFormStatus and useOptimistic), the use API, ref as a regular prop, built-in document metadata, and stable Server Components for frameworks such as Next.js. This guide explains each feature with examples, what was removed, and how to upgrade. The current release line is React 19.2, from October 2025.
Actions: async updates without the boilerplate
Before React 19, every form submission meant hand-written state for "pending", "error" and "success". An Action is an async function that React runs in a transition and tracks for you. You can pass one straight to a form's action prop, and the form resets automatically after a successful submission.
useActionState
useActionState wraps an Action and gives you its latest result and a pending flag:
import { useActionState } from 'react';
async function updateName(previousState: string | null, formData: FormData) {
const name = formData.get('name') as string;
const res = await fetch('/api/profile', { method: 'POST', body: JSON.stringify({ name }) });
if (!res.ok) return 'Could not save your name. Please try again.';
return null; // no error
}
export function ProfileForm() {
const [error, formAction, isPending] = useActionState(updateName, null);
return (
<form action={formAction}>
<input name="name" required />
<button type="submit" disabled={isPending}>
{isPending ? 'Saving...' : 'Save'}
</button>
{error && <p role="alert">{error}</p>}
</form>
);
}
useFormStatus
Design-system buttons often need to know whether their form is submitting. useFormStatus, imported from react-dom, reads the status of the parent form without passing props down:
import { useFormStatus } from 'react-dom';
export function SubmitButton({ label }: { label: string }) {
const { pending } = useFormStatus();
return <button type="submit" disabled={pending}>{pending ? 'Working...' : label}</button>;
}
useOptimistic
useOptimistic shows the expected result immediately while the request is still running, then switches to the real data, or back, when it finishes. It suits likes, comments and to-do lists:
import { useOptimistic } from 'react';
export function Comments({ comments, addComment }: {
comments: string[];
addComment: (text: string) => Promise<void>;
}) {
const [optimisticComments, addOptimistic] = useOptimistic(
comments,
(current, newComment: string) => [...current, newComment]
);
async function submit(formData: FormData) {
const text = formData.get('text') as string;
addOptimistic(text); // appears instantly
await addComment(text); // real request
}
return (
<form action={submit}>
<ul>{optimisticComments.map((c, i) => <li key={i}>{c}</li>)}</ul>
<input name="text" />
</form>
);
}
The new use API
use reads the value of a promise or a context during render. With a promise, the component suspends until it resolves and the nearest <Suspense> boundary shows its fallback. Unlike other hooks, use can be called inside conditions and loops:
import { use, Suspense } from 'react';
function Comments({ commentsPromise }: { commentsPromise: Promise<string[]> }) {
const comments = use(commentsPromise); // suspends until resolved
return <ul>{comments.map((c) => <li key={c}>{c}</li>)}</ul>;
}
export function Post({ commentsPromise }: { commentsPromise: Promise<string[]> }) {
return (
<Suspense fallback={<p>Loading comments...</p>}>
<Comments commentsPromise={commentsPromise} />
</Suspense>
);
}
Pass in a promise created by a framework or a cache. A promise created fresh inside the component would restart on every render.
ref as a prop, and other quality-of-life changes
ref is a normal prop: function components can accept
refdirectly, soforwardRefis no longer needed and will be deprecated in a future version.Ref cleanup functions: a ref callback can return a cleanup function, which runs when the element is removed.
<Context> as a provider: write
<ThemeContext value="dark">instead of<ThemeContext.Provider>.Clearer hydration errors: mismatches now show one error with a diff of what the server and client rendered.
Custom elements: Web Components are fully supported, including passing properties.
// React 19: no forwardRef needed
function TextInput({ placeholder, ref }: { placeholder: string; ref?: React.Ref<HTMLInputElement> }) {
return <input placeholder={placeholder} ref={ref} />;
}
Document metadata and stylesheets
You can render <title>, <meta> and <link> tags anywhere in your component tree, and React moves them into the document <head>. Stylesheets can declare a precedence so React inserts them in the right order and waits for them to load before showing the content that needs them. In Next.js you will usually keep using its Metadata API, but this helps in plain React apps.
function BlogPost({ post }: { post: { title: string; summary: string } }) {
return (
<article>
<title>{post.title}</title>
<meta name="description" content={post.summary} />
<h1>{post.title}</h1>
</article>
);
}
Server Components and Server Actions
React Server Components render on the server and send HTML and data, not component code, to the browser, which keeps JavaScript bundles small. In React 19 they are stable for frameworks that support them, such as the Next.js App Router. Server Actions, functions marked with 'use server', let Client Components call server code directly, and they work with the form Actions above. Read what's new in Next.js 16 for how a framework builds on these features.
The React Compiler
The React Compiler is a separate, optional build-time tool that memoizes components and values automatically, so you rarely need useMemo, useCallback or React.memo by hand. It reached a stable 1.0 release in October 2025 and works with React 17, 18 and 19, so you can adopt it gradually, one directory at a time.
What's new since React 19.0
<Activity> (19.2): hides part of the UI while keeping its state, and can render it in the background so it is ready when shown.
useEffectEvent (19.2): pulls non-reactive logic out of effects, so an effect doesn't re-run just because a callback changed.
Breaking changes and removed APIs
Most apps upgrade with few changes, but React 19 removes long-deprecated APIs:
ReactDOM.renderandReactDOM.hydrate: usecreateRootandhydrateRootfindDOMNodeand string refs: use ref objects or callbackspropTypesare ignored anddefaultPropsno longer work on function components: use TypeScript and default parameter valuesLegacy context (
contextTypes): usecreateContextErrors thrown during render are no longer re-thrown; they are reported to
window.reportErroror your error boundaries
How to upgrade to React 19
Upgrade to React 18.3 first. It is identical to 18.2 but warns about everything React 19 removes.
Install the new versions:
npm install react@^19 react-dom@^19, plus@types/react@^19and@types/react-dom@^19if you use TypeScript.Run the official codemods:
npx codemod@latest react/19/migration-recipefor code andnpx types-react-codemod@latest preset-19 ./srcfor types.Check that your key libraries (routing, forms, UI kits, testing) support React 19, then test forms, refs and hydration carefully.
Should you upgrade?
For new projects, start on React 19; frameworks such as Next.js already use it. For existing apps, upgrade once your main dependencies support it. The Actions and form hooks alone remove a lot of state-management code, and the stricter cleanup of old APIs makes future upgrades easier.
Conclusion
React 19 is less about one headline feature and more about removing everyday friction: forms and async updates are simpler with Actions and the new hooks, use makes data loading with Suspense natural, refs and context need less ceremony, and Server Components are ready for production in supported frameworks. For full details, see the official React 19 release post and the React 19 upgrade guide. Planning a new React or Next.js app? See my web app development services.
Frequently Asked Questions
Is React 19 stable?
Yes. React 19 was released as a stable version in December 2024 and is supported by frameworks such as Next.js.
Do I need the React Compiler to use React 19?
No. The React Compiler is an optional build-time tool that automatically memoises components. React 19 works without it, and you can adopt the compiler later.
Should I upgrade to React 19?
For new projects, yes. For existing apps, upgrade once your key libraries support React 19, and test forms, hydration and any code that relies on deprecated APIs.
Tags
Get the latest articles and tutorials delivered to your inbox.
Subscribe Now
