Home / Learn React / What Is New in React 19

What Is New in React 19

React 19 (and 19.1, 19.2) made common tasks simpler: Actions, use, ref as a prop, context as a provider, document metadata, better errors and new APIs such as Activity.

In shortQuick tour of the new features, each with a tiny example, so you can read modern React code and know what changed from React 18.

Theory in plain words

React 19 at a glanceActions: form action, useActionState, useFormStatus, useOptimisticuse() for promises and contextSimpler APIs: ref as prop, Context as provider, ref cleanupDocument: title, meta and link tags in components, preload APIs19.2: Activity, useEffectEvent, better Suspense batching
React 19 at a glance

What it is

React 19 is the current major version. It keeps your old code working but adds simpler ways to do forms, data, refs and metadata.

Why we use it

Knowing what is new lets you read tutorials from every year and write less code. Many old patterns such as forwardRef and Context.Provider are no longer needed.

How it works

Most features are small API changes in react and react-dom. A few (Server Components, Server Actions) need a framework or bundler support.

Where it is used

  • Reading modern tutorials and codebases
  • Migrating from React 18
  • Interview questions about "what changed"
FeatureBefore (React 18)Now
Form submitonSubmit + state for loading and errors<form action={fn}> + useActionState
Refs in function componentsforwardRefref is a normal prop
Context provider<Ctx.Provider value><Ctx value>
Read a promiseFetch in useEffectuse(promise) with Suspense
Page title and metareact-helmet or manual DOM code<title>, <meta>, <link> inside components
Ref cleanupCall with nullReturn a cleanup function from the ref callback
Custom elementsPartly supportedFull support for props and events

Metadata in components

title and meta anywhereTry it Yourself

Look at the head of this preview with the inspector: the title and meta tags are in <head>.

Activity (19.2)

Hide a part and keep its stateTry it Yourself

Activity hides a subtree but keeps its state and pauses its effects, unlike unmounting.

useEffectEvent (19.2)

Read the latest value inside an effectTry it Yourself

Effect Events can only be called from inside effects. They are not put in the dependency list.

Tip:Upgrading from 18? Run the official codemods and read the upgrade guide on react.dev. Most apps need only small changes.

Quick quiz

1. In React 19 how does a function component get ref?

2. How can you provide a context in React 19?

3. What does Activity mode="hidden" do?

4. Where do title and meta tags rendered in a component go?

Common questions

In React 19 how does a function component get ref?

As a normal prop. ref is a prop.

How can you provide a context in React 19?

<Ctx value={x}>. The context itself can be the provider.

What does Activity mode="hidden" do?

Hides the UI and keeps its state. State is kept, effects are paused.