React 19.2 Introduces Activity Component to Preserve Hidden UI State
React 19.2 has shipped a new built-in component called Activity, which keeps hidden UI subtrees alive without unmounting them. Instead of removing elements from the DOM, Activity applies display:none to hidden children while preserving useState, useReducer, and DOM state. When a panel is hidden, its effects and cleanup still run, meaning resources like WebSocket connections are properly closed but in-memory state is retained for when the panel becomes visible again. Hidden Activity boundaries continue to render at the lowest priority, allowing routes or panels to prefetch data in the background before a user navigates to them. The feature is aimed at stateful UI regions such as tab groups and is available as a stable release with no opt-in flag required.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in