Agentic AI
React 19.3 adds browser() API for cleaner client-only component rendering
The latest React release introduces a first-class way to opt components out of server-side rendering, replacing ad-hoc workarounds that often trigger hydration mismatches.
InfoQ
React 19.3 arrived on npm in September, bringing stable View Transitions and Fragment Refs alongside a more streamlined solution for a long-standing problem in server-side rendering: how to cleanly exclude components that depend on browser-only APIs.
The new browser() API gives developers a formal, declarative way to tell React that a component cannot render on the server. It integrates with the use() hook, which causes the component to suspend during server rendering while allowing normal operation after hydration in the browser.
The Problem with Browser-Only Code#
Components that access localStorage, window, or device-specific properties like timezone have no meaningful server-side rendering. Until now, developers relied on fragile workarounds: flipping a mounted flag in an effect hook or guarding rendering with typeof window !== 'undefined'. Both patterns risk hydration mismatches—situations where the server HTML and initial client render disagree, causing runtime errors.
How the New API Works#
Using browser() is straightforward:
import { use } from 'react';
import { browser } from 'react-dom';
function LocalTime() {
use(browser());
return <p>{new Intl.DateTimeFormat().resolvedOptions().timeZone}</p>;
}
On the server, calling use(browser()) suspends the component and renders its nearest Suspense boundary fallback instead. In the browser, it returns undefined, allowing the component to render normally. The function must be called from a Client Component within a Suspense boundary, or server rendering will fail.
Because use() can live behind conditional logic, components can defer selectively—for example, a data hook that renders on the server when initialData is provided but opts out when fetching client-side. React also provides an onBrowserBailout callback and optional reason argument so teams can instrument exactly where server rendering was skipped.

