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]: Clarify restrictions on rendering <html> and <body> tags inside the component tree to prevent infinite loops in React 19 #8340
Add an explicit warning to the React 19 Upgrade Guide and Metadata documentation stating that <html> and <body> tags are not supported for native hoisting. Clarify that rendering these tags inside a createRoot tree causes a terminal infinite loop (browser freeze) during event propagation (e.g., input focus), especially since many developers are currently migrating away from react-helmet to React 19's native metadata handling.
In React 19, rendering an <html> or <body> tag within a custom component tree (nested under a createRoot container) causes a critical browser freeze (100% CPU usage) due to this issue#35480.
I encountered this issue while refactoring an existing application to remove the react-helmet dependency. With the introduction of Metadata Hoisting, it seemed logical to replace library-managed tags with native JSX tags. However, while React 19 successfully hoists <title>, <meta>, and <link>, it fails to handle <html> or <body> in the same way. Instead of a warning or a graceful fallback, it results in a terminal infinite loop during event propagation (e.g., when clicking an input).
For example, I replaced my existing react-helmet logic with a direct JSX tag, expecting React to manage the lang attribute:
// This refactoring caused the terminal hang:
<Wrap>
{/* I moved this out of <Helmet> thinking it was now supported natively */}
<html lang={locale} />
<Content>{children}</Content>
</Wrap>
Hi, I'd like to work on this documentation improvement. I'll add a clear note with a code example explaining why rendering and inside a component tree causes infinite loops in React 19. Will submit a PR
Activity
ranisa-gupta16 commentedon Mar 19, 2026
Hi, I'd like to work on this documentation improvement. I'll add a clear note with a code example explaining why rendering and inside a component tree causes infinite loops in React 19. Will submit a PR
F0RREALTHO commentedon Mar 28, 2026
I'd like to work on this. Will submit a PR with a warning note about and not being supported inside createRoot
docs: add warning for html/body tags causing infinite loop in React 19 (
F0RREALTHO commentedon Mar 28, 2026
I've submitted a PR for this: #8380