The biggest React release in years, and what it means for your apps.
- React 19 introduces Actions — a built-in way to handle async updates, pending states and errors.
- New hooks include useActionState, useFormStatus and useOptimistic, plus the use() API for reading promises and context.
- Server Components and Server Actions are now stable for frameworks such as Next.js.
- Quality-of-life changes include ref as a prop, document metadata support and better hydration error messages.
Why React 19 is a big release
React 19 is the most significant update to React in years. It focuses on a problem every React developer knows: handling data mutations — forms, API calls, pending states, errors and optimistic updates — without piles of boilerplate. It also makes Server Components stable, changing how full-stack React apps are built.
Actions: async updates made simple
An Action is an async function used inside a transition. React tracks its pending state, handles errors and resets forms automatically. You can pass a function directly to a form’s action prop, and React will call it with the form data.
useActionState
useActionState connects an Action to a piece of state. It returns the latest result, a wrapped action to pass to your form, and a pending flag.
import { useActionState } from "react";
async function subscribe(prevState, formData) {
const email = formData.get("email");
const res = await fetch("/api/subscribe", { method: "POST", body: JSON.stringify({ email }) });
return res.ok ? { ok: true } : { error: "Something went wrong" };
}
export function Newsletter() {
const [state, formAction, isPending] = useActionState(subscribe, null);
return (
<form action={formAction}>
<input name="email" type="email" required />
<button disabled={isPending}>{isPending ? "Joining…" : "Join"}</button>
{state?.error && <p>{state.error}</p>}
</form>
);
}useFormStatus and useOptimistic
- useFormStatus lets a child component (like a submit button) read whether its parent form is submitting — no prop drilling.
- useOptimistic shows the expected result immediately (for example, a new comment) while the request is still in progress, then reconciles with the server response.
The new use() API
use() reads the value of a promise or a context during render. With Suspense, components can simply “use” data that is loading, and React shows the nearest fallback until it resolves. Unlike hooks, use() can be called conditionally.
import { use, Suspense } from "react";
function Comments({ commentsPromise }) {
const comments = use(commentsPromise);
return comments.map((c) => <p key={c.id}>{c.text}</p>);
}
export function Post({ commentsPromise }) {
return (
<Suspense fallback={<p>Loading comments…</p>}>
<Comments commentsPromise={commentsPromise} />
</Suspense>
);
}Server Components and Server Actions
Server Components render on the server and send HTML and a compact payload to the browser — no client-side JavaScript for those components. They can read from databases or APIs directly. Server Actions let client components call server functions (marked with "use server") for mutations like saving a form.
These features are used through frameworks. Next.js’s App Router is the most popular way to use them today — learn more about our Next.js development work.
Other improvements worth knowing
- ref as a prop — function components can receive
refdirectly, soforwardRefis no longer needed in new code. - `<Context>` as a provider — render
<ThemeContext value=…>instead of<ThemeContext.Provider>. - Document metadata —
<title>,<meta>and<link>tags rendered in components are hoisted to the document head. - Stylesheet and resource loading — better support for stylesheets with precedence, plus
preloadandpreinitAPIs. - Ref cleanup functions and clearer hydration error messages.
What React 19 means for business owners
You don’t need to know what a hook is to benefit from React 19. For businesses, the changes translate into practical gains:
- Faster pages — Server Components send less JavaScript to the browser, which helps on slower mobile networks.
- Better SEO — server-rendered content is easier for search engines to read.
- Smoother forms — built-in pending and optimistic states make checkouts and enquiry forms feel instant.
- Lower maintenance — less boilerplate code means fewer bugs and quicker changes.
Upgrade checklist
- Upgrade to the latest React 18.x first and fix any deprecation warnings.
- Update React, React DOM and type definitions to version 19.
- Run the official codemods to handle removed APIs.
- Update libraries that depend on React (routers, form and UI libraries).
- Test critical flows — login, forms, checkout — in a staging environment.
- Deploy gradually and monitor errors.
Should you upgrade?
For most apps on React 18, upgrading is straightforward. Read the official upgrade guide, update dependencies, run the provided codemods and test thoroughly — some long-deprecated APIs have been removed. New projects should start on React 19 directly, often together with the React Compiler for automatic memoisation.
Need help upgrading or building with React 19? Hire a React.js developer from SpyCoder or talk to our web development team.
Talk to the SpyCoder team for a free consultation and a fixed-price proposal within 48 hours.