You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Suggestion]: Document how to animate a full-page navigation with only the root snapshot in <ViewTransition> #8732
The <ViewTransition> reference does not explain how to animate a full-page navigation (for example a push/slide between routes) with only the root snapshot (::view-transition-old(root) / ::view-transition-new(root)). The obvious approach, a <ViewTransition> around the page, makes the browser capture the whole page element, including everything outside the viewport. On tall pages this costs hundreds of MB per navigation. Please document the recommended pattern for root-only page transitions and when React keeps or cancels the root snapshot.
A router-based app animates every navigation as a full-page slide (old page out, new page in). With React Router's deprecated viewTransition option this used the root snapshot: <html> keeps the default view-transition-name: root, so the browser captures a viewport-sized image. To move off the deprecated option, the page shell was wrapped in <ViewTransition update="page-transition">.
What happens with a page-wide boundary
React puts a view-transition-name on the page element inside the boundary.
For a named element, the spec captures the element's ink overflow rectangle (CSS View Transitions 1, "Capture the image"), not only the visible part. A page element that is many screens tall therefore produces a full-height snapshot.
Measured on iOS: about +600 MB in the web content process for each navigation on a tall page. In a reduced test case (24,000px tall named element, iPhone 17 Pro simulator, iOS 26.5), each transition kept about 330 MB, which matches one full-height snapshot at 3x scale. On iOS this memory is also not released, which I reported to WebKit separately: WEBKIT_BUG_LINK
The same navigation with only the root snapshot stays flat (23 MB after 50 transitions in the same test case).
What I found in the React DOM source (react-dom 19.3.1)
Please correct me if I read this wrong:
React only calls document.startViewTransition() when at least one <ViewTransition> boundary is activated in the commit (update, enter, exit or share).
During the transition, React keeps the root snapshot only when the commit changed the DOM outside every boundary (rootViewTransitionAffected). Otherwise it cancels the root: it sets view-transition-name: none on <html> and hides ::view-transition-group(root) (rootViewTransitionNameCanceled).
So a root-only page transition seems to need a small boundary that only activates the transition (for example a keyed enter on a tiny element), with the page content outside every boundary, plus CSS for ::view-transition-old(root) / ::view-transition-new(root). This relies on behavior that the docs do not describe, so it is unclear whether it is supported.
Suggested additions to the docs
The recommended pattern for full-page route transitions that should use only the root snapshot.
When React keeps the root snapshot and when it cancels it (point 2 above).
A note that a <ViewTransition> around a tall or scrolling element captures the element's full size, not only the viewport, and that this can use a lot of memory, especially on mobile devices.
Reacted by Tim Anthony Alexander and yakubovmax213
Activity
Solankiiii01 commentedon Nov 4, 2026
/assign-me