React, the UI library from Meta, has published version 19.2, introducing a batch of new APIs, performance improvements, and server-rendering enhancements. The update adds first-class primitives for activity control, effects and signal caching.
React 19.2 ships several new core features. The Activity component lets developers break UIs into named ‘activities’ that can be conditionally rendered or suspended.
Traditionally, a developer could use conditionals to hide or show a component, for example:
{isHidden && (
<Component />
)}
Instead, the new Activity component can be used:
<Activity mode={isHidden ? 'hidden' : 'visible'}>
<Component />
</Activity>
The new component supports visible and hidden modes, enabling finer control over UI segments. Activity will enable developers to pre-render components while hidden from users. It preserves its state while hidden. The React team has indicated that they will be adding more modes to Activity in the future.
A new useEffectEvent hook provides a mechanism to decouple the event portion of useEffect logic into a separate hook. This is useful when developers have an effect that uses a value but should not re-run when that value changes. With useEffectEvent
, any values referenced within the event are not required to be used in the dependency array in the useEffect
. The release notes also specify that you should not use the effect event in the dependency array of a useEffect
either. A new version of eslint-plugin-react-hooks has been released to provide support for the changes.
There has been mixed feedback on the introduction of useEffectEvent
, with a user commenting on X that React is trying to solve problems inflicted on itself
and another that they have created a whole new hook just to fix a linting rule
. A React core team member has replied to some of these criticisms, arguing that it is not just a React problem, and all reactive models have ways to opt out of reactivity, citing ‘untrack’ examples from other frameworks.
A developer on reddit believes that the new hook has been sorely needed since hooks were first introduced
.
React 19.2 also introduces cacheSignal, which provides the ability to know when the cache()
lifetime is over within React Server Components. It returns an AbortSignal as soon as the components cache()
expires, giving control to developers to clean up any ongoing operations.
On the React DOM front, Partial Pre-Rendering has been added in 19.2. Portions of the application can be pre-rendered server-side and then resume rendering later to add in dynamic content, improving initial load responsiveness.
Several internal changes are also part of the release, such as a bug fix for Batching Suspense Boundaries for SSR. Suspense boundaries will now batch when server rendered, resulting in content being revealed together rather than at different times.
Web Streams support has been added with renderToReadbleStream, prerender, resume and resumeAndPrerender all now available. Although there is a note in the docs which recommends to use Node Streams over Web Streams, as Node Streams are much faster and Web Streams do not support compression by default.
React 19.2 is the third release since 19.0, following 19.1 earlier this year, and continues the steady cadence of incremental improvements. Developers can find the full list of changes over on the React blog.
React is an open-source JavaScript library for building user interfaces declaratively and efficiently. It is used across the web and native ecosystems, offering features like hooks, concurrent rendering, server components, and an evolving compiler.