Skip to main content

Cloudsoft Zone Build, deploy and scale with practical guides to PHP, Node.js, React, DevOps and AI automation. Explore the guides

Cloudsoft Zone
JavaScriptIndustry update

React 19.3 explained: ViewTransition, Fragment refs and browser()

React 19.3, released on 9 September 2026, makes ViewTransition and Fragment refs stable, adds browser() to React DOM, supports Trusted Types and lets Server Components render Context directly. Here is what each change replaces and how to upgrade.

Nilesh Kushvaha

Updated 8 min read

Cloudsoft Zone cover: React 19.3 explained: ViewTransition, Fragment refs and browser()
Image: Cloudsoft Zone
In this article

React 19.3 was released on 9 September 2026. It is a minor release, and the React team describes it as having no breaking changes, but it moves several long-awaited features out of the experimental channel: the <ViewTransition> component, refs on <Fragment>, a new browser() function in React DOM, built-in support for the Trusted Types browser API, and direct rendering of Context providers from Server Components.

React 19.3 ViewTransition leads a release that also brings refs on Fragment, a browser() function in React DOM, Trusted Types support and Server Component Context. For each feature you will see what it replaces in your code and whether it is safe to adopt now.

If you maintain a React application, the practical questions are what each feature replaces in your current code, which ones are safe to adopt now, and what to check before upgrading. This article answers those questions using the official React 19.3 release post and the React documentation, with short code examples you can adapt.

All examples assume react and react-dom 19.3.0, the versions listed in the release post.

At a glance: what changed in React 19.3

FeaturePackageWhat it replaces
<ViewTransition> and addTransitionTypereactHand-written calls to document.startViewTransition() or animation libraries for enter/exit effects
Fragment refsreactWrapper <div> elements added only to attach a ref, observer or listener
browser()react-dom"Has mounted" state and useEffect checks for browser-only components
Trusted Types supportreact-domWorkarounds for sites enforcing require-trusted-types-for 'script'
Rendering <Context> from Server ComponentsReact Server ComponentsSmall client wrapper components that only provide a Context value
Cyan atom-shaped React logo with three elliptical orbits around a central dot
React 19.3 moves ViewTransition and Fragment refs from the experimental channel to stable.

React 19.3 ViewTransition: animations driven by Transitions

The View Transition API lets browsers animate between two DOM states. MDN's compatibility data lists document.startViewTransition() in Chrome and Edge from version 111, Safari from 18 and Firefox from 144. React's <ViewTransition> component wraps that API so you describe what should animate instead of orchestrating it manually.

JSX
import { ViewTransition } from 'react';

{isShowing && (
  <ViewTransition>
    <Component />
  </ViewTransition>
)}

React decides which animation applies based on what happened in the tree: enter when a <ViewTransition> is added, exit when it is removed, update when its children change, and share when a named <ViewTransition> moves from one place to another.

Only Transitions animate

The most important rule in the release post is that only updates marked as Transitions animate: updates inside startTransition(), <Suspense> reveals and useDeferredValue(). Urgent updates, such as typing into an input, do not. If an animation does not run, the first thing to check is whether the state change is wrapped in startTransition.

Direction-aware animations with addTransitionType

The new addTransitionType function labels a Transition with a reason, and <ViewTransition> props can map those labels to CSS animation classes:

JSX
import { startTransition, addTransitionType, ViewTransition } from 'react';

function nextSlide() {
  startTransition(() => {
    addTransitionType('next');
    setCurrentSlide((c) => c + 1);
  });
}

function previousSlide() {
  startTransition(() => {
    addTransitionType('previous');
    setCurrentSlide((c) => c - 1);
  });
}

<ViewTransition
  enter={{ next: 'from-right', previous: 'from-left' }}
  exit={{ next: 'to-left', previous: 'to-right' }}
>
  <Page />
</ViewTransition>

The class names (from-right and so on) are your own CSS. Respect users who have asked for less motion: wrap animation rules in a @media (prefers-reduced-motion: no-preference) block, which also helps you meet WCAG 2.2 guidance on motion from interactions.

Animating Suspense boundaries

Wrapping a <Suspense> boundary in <ViewTransition> animates the swap from fallback to content. The release post recommends this pattern so only the reveal animates:

JSX
<ViewTransition update="auto" default="none">
  <Suspense fallback={<Fallback />}>
    <Component />
  </Suspense>
</ViewTransition>

According to the post, images and fonts inside a <ViewTransition> also trigger Suspense while loading, which avoids flashes of half-loaded content. The feature is DOM-only for now; React Native support is described as in progress.

Fragment refs: no more wrapper divs

Attaching a ref to a group of siblings used to require a wrapping element, which could break CSS grid or flex layouts and add noise to the accessibility tree. In React 19.3, <Fragment ref={...}> is stable. The ref receives a FragmentInstance with methods that act on the fragment's children:

  • Events: addEventListener(), removeEventListener(), dispatchEvent()
  • Focus: focus(), focusLast(), blur()
  • Observers: observeUsing() and unobserveUsing() for IntersectionObserver and ResizeObserver
  • Layout: getClientRects(), getRootNode(), compareDocumentPosition(), scrollIntoView()

A visibility tracker no longer needs an extra element:

JSX
import { Fragment, useLayoutEffect, useRef } from 'react';

export default function InView({ onChange, children }) {
  const fragmentRef = useRef(null);

  useLayoutEffect(() => {
    const visible = new Set();
    const observer = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) visible.add(e.target);
        else visible.delete(e.target);
      }
      onChange(visible.size > 0);
    });
    const fragment = fragmentRef.current;
    fragment.observeUsing(observer);
    return () => fragment.unobserveUsing(observer);
  }, [onChange]);

  return <Fragment ref={fragmentRef}>{children}</Fragment>;
}

The focus() method moves focus to the first focusable descendant, searched depth-first, which is useful for dialogs and dynamically inserted form sections where you want predictable keyboard focus.

Visual Studio Code on Ubuntu with a React JavaScript project open in the editor
Fragment refs remove wrapper elements that existed only to hold refs or observers.

browser(): opting a component out of server rendering

Some components can only produce correct output in the browser: anything that reads the user's time zone, screen size or local storage. The usual workaround was an isMounted state set in useEffect, which renders twice and is easy to get wrong. React DOM 19.3 adds browser(), used with use():

JSX
import { Suspense, use } from 'react';
import { browser } from 'react-dom';

function TimeZone() {
  use(browser());
  const timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
  return <p>{timeZone}</p>;
}

export default function App() {
  return (
    <>
      <p>Your current time zone is:</p>
      <Suspense fallback="Loading…">
        <TimeZone />
      </Suspense>
    </>
  );
}

On the server, use(browser()) suspends, so the HTML contains the nearest Suspense fallback. In the browser it does not suspend, and the component renders after hydration. Because it is an ordinary use() call, it can be conditional: the release post shows a component that renders a server-provided default when one exists and only falls back to browser rendering when it does not.

Use it sparingly. Content that is skipped on the server is not in the initial HTML, which affects both search engines and users on slow connections. Prefer server-rendered defaults and reserve browser() for values that truly only exist on the client.

Trusted Types and Server Component Context

Trusted Types

Trusted Types is a browser API that helps prevent DOM-based cross-site scripting by requiring typed values, such as TrustedHTML, for dangerous sinks. Previously React converted every value to a string, which defeated the check. React 19.3 passes TrustedHTML, TrustedScript and TrustedScriptURL objects through unchanged, so it works with a Content-Security-Policy: require-trusted-types-for 'script' header. If you already use a strict CSP, this is a good time to evaluate Trusted Types.

Rendering Context from Server Components

Server Components can now render a Context exported from a 'use client' module directly, without a client wrapper component:

JSX
// user-context.js
'use client';
import { createContext } from 'react';
export const UserContext = createContext(null);

// layout.js (Server Component)
import { UserContext } from './user-context';

export async function Layout({ children }) {
  const currentUser = await getCurrentUser();
  return <UserContext value={currentUser}>{children}</UserContext>;
}

This removes a small but common piece of boilerplate in Next.js-style applications.

Other notable fixes

The release also includes behaviour changes and bug fixes that may affect existing apps:

  • Transitions now render independently instead of being entangled, so a slow Transition no longer blocks others.
  • Strict Mode now double-invokes Effects during hydration, which may surface cleanup bugs in development that were hidden before.
  • Resize events are batched until the next frame.
  • Fixes for useDeferredValue getting stuck on old values, context propagation into Suspense fallbacks, and defaultValue on number inputs.
  • New onFullscreenChange and onFullscreenError events, and support for fetchPriority on module resources and the credentialless attribute on iframes.

Should you adopt the new features now?

The features differ in risk. Fragment refs and the Server Component Context change are low-risk refactors: they remove code rather than add behaviour, and you can verify them with existing tests. Trusted Types support is passive; it only matters if you enforce the policy, and then it removes a blocker.

<ViewTransition> deserves more care. Animations change how a page feels, can distract users with vestibular disorders, and depend on browser support for the View Transition API. Introduce it on one interaction, test with reduced-motion settings enabled, and check older Firefox versions, which MDN lists as supporting startViewTransition() only from version 144.

browser() is the most architectural change. Moving a component to browser-only rendering changes what is in your HTML, so review it with whoever owns SEO and performance. If your framework already offers a client-only mechanism, compare the two before standardising on one.

Upgrade checklist

  1. Update react and react-dom together to 19.3.0, along with any framework that pins them.
  2. Run your app in Strict Mode in development and watch for new double-invocation warnings during hydration.
  3. Replace wrapper divs that only exist to hold refs or observers with <Fragment ref>, checking layout and accessibility afterwards.
  4. Replace "has mounted" patterns with use(browser()) where server rendering is genuinely impossible.
  5. Introduce <ViewTransition> in one area first, with reduced-motion CSS, and confirm the triggering updates are Transitions.
  6. If you send a CSP header, test with Trusted Types enforcement in report-only mode before enforcing it.

Summary

React 19.3 is a low-risk upgrade with meaningful new tools. <ViewTransition> brings native browser animations into React's Transition model, Fragment refs remove layout-breaking wrapper elements, browser() gives a clean way to defer client-only components, and Trusted Types support makes strict security policies practical. Read the official release post and changelog for the full list before upgrading production apps.

Frequently asked questions

  • Does React 19.3 have breaking changes?

    The React team describes 19.3 as backward compatible with no breaking changes. Note that Strict Mode now double-invokes Effects during hydration in development, which may surface existing cleanup bugs.

  • Why does my ViewTransition not animate?

    Only updates marked as Transitions animate: state changes inside startTransition(), Suspense reveals and useDeferredValue(). Urgent updates such as typing do not trigger animations.

  • Is browser() the same as a client component?

    No. 'use client' components still render on the server for the initial HTML. use(browser()) suspends during server rendering, so the HTML contains the nearest Suspense fallback and the component renders only in the browser.

  • Does ViewTransition work in React Native?

    Not yet. The release post says it is currently DOM-only and that React Native support is in progress.

Sources

  1. React 19.3 — React, 2026-09-09
  2. React Versions — React
  3. React Blog — React
  4. MDN browser-compat-data 8.1.4 (data.json) — MDN Web Docs, 2026-10-01
Cloudsoft Zone cover: DisposableStack is not defined: fix it and use JavaScript using

TutorialJavaScript9 min read73 views

DisposableStack is not defined: fix it and use JavaScript using

“DisposableStack is not defined” means the runtime does not support it yet: Safari on Mac, every browser on iOS, and Node.js before 24. Update it or load a polyfill, then use using and await using for automatic cleanup.

New tools, once a week

One short email listing what joined the directory.

The weekly email about new tools and occasional newsletters. Unsubscribe at any time.

Comments

No comments yet. Be the first to join the conversation.

Leave a comment

Every comment is read by a moderator before it appears. Your email address is never published; it is used only to contact you about this comment.

Never published. Used only to contact you about this comment.

Loading the security check…

Comments are moderated before publication.