Avolve

React 19.2

v19.2.0
Stable

JavaScript library for building user interfaces with Server Components, Actions, and automatic optimization via the React Compiler.

Stack Compatibility (Oct 2025)
Verified versions tested together in production
DependencyVersionStatus
Next.js15.5.4 Compatible
TypeScript5.9.2 Compatible
Node.js24.8.0 Compatible
Vercel AI SDK5.0.48 Compatible

Getting Started

React 19.2 comes automatically with Next.js 15.5. No additional configuration needed.

terminalbash
# Create new Next.js app with React 19.2
npx create-next-app@latest my-app

# Verify React version
npm list react react-dom

Integration Patterns

Server Actions with useActionState

React 19's useActionState hook simplifies form handling with automatic pending states.

app/actions.tstypescript
1'use server'
2
3export async function createUser(prevState: any, formData: FormData) {
4 const name = formData.get('name') as string;
5 const email = formData.get('email') as string;
6
7 // Validate
8 if (!name || !email) {
9 return { error: 'Name and email required' };
10 }
11
12 // Save to database
13 const user = await db.users.create({ name, email });
14
15 return { success: true, user };
16}
app/components/user-form.tsxtypescript
1'use client'
2
3import { useActionState } from 'react';
4import { createUser } from './actions';
5
6export function UserForm() {
7 const [state, formAction, isPending] = useActionState(createUser, null);
8
9 return (
10 <form action={formAction}>
11 <input name="name" required />
12 <input name="email" type="email" required />
13 <button disabled={isPending}>
14 {isPending ? 'Creating...' : 'Create User'}
15 </button>
16 {state?.error && <p className="error">{state.error}</p>}
17 {state?.success && <p className="success">User created!</p>}
18 </form>
19 );
20}

Server Components + AI Streaming

Combine React Server Components with Vercel AI SDK for streaming AI responses.

app/components/ai-response.tsxtypescript
1import { openai } from '@ai-sdk/openai';
2import { streamText } from 'ai';
3
4export default async function AIResponse({ prompt }: { prompt: string }) {
5 // Server Component - runs on server only
6 const result = await streamText({
7 model: openai('gpt-4'),
8 prompt,
9 });
10
11 // Stream text directly to client
12 return result.textStream;
13}

What Breaks in Production

Real issues we've encountered with React 19 and how to fix them.

useFormStatus only works in child components

Symptom: useFormStatus always returns pending: false even during submission

Cause: useFormStatus must be used in a component that's a child of the <form>

Fix: Extract button into separate component

// ❌ Wrong - useFormStatus in same component as form
function MyForm() {
  const { pending } = useFormStatus(); // Always false!
  return <form><button disabled={pending}>Submit</button></form>;
}

// ✅ Right - useFormStatus in child component
function SubmitButton() {
  const { pending } = useFormStatus();
  return <button disabled={pending}>Submit</button>;
}

function MyForm() {
  return (
    <form action={myAction}>
      <SubmitButton />
    </form>
  );
}
React Compiler requires explicit opt-in

Symptom: Components not automatically optimized despite React 19

Cause: React Compiler is opt-in, not automatic in React 19

Fix: Add babel-plugin-react-compiler to your build

next.config.jsjavascript
// next.config.js
module.exports = {
  experimental: {
    reactCompiler: true, // Enable React Compiler
  },
};
Context Provider shorthand breaks types

Symptom: TypeScript errors when using Context directly as Provider

Cause: React 19 allows <Context> instead of <Context.Provider>, but TypeScript types lag behind

Fix: Continue using <Context.Provider> until TypeScript 5.10

// ✅ Works in React 19 but TypeScript may complain
<MyContext value={value}>
  {children}
</MyContext>

// ✅ Always works - use this for now
<MyContext.Provider value={value}>
  {children}
</MyContext.Provider>