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
Commit 7831e15
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(rsc): keep >, quotes and & as written in server component styles on React 18 (#5881)
* fix(rsc): keep >, quotes and & as written in server component styles on React 18
React before 19 HTML-escapes <style> text children during server rendering, so Next.js 13.5 and 14 sent '.a > .b' to the browser. Pass the CSS through dangerouslySetInnerHTML on those versions, with </style escaped as \3C/style; React 19 keeps text children. Fixes#5824.
Co-Authored-By: Rahul Kashayp <[email protected]>
* fix(rsc): gate React version check on IS_RSC, preserve case on closing-tag escape, and avoid spread allocation
* fix(types): narrow StyleElementProps index signature for React.Attributes data-* augmentation
* test(treeshake): pin browser DCE patterns against serverESM positive control
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Evan Jacobs <[email protected]>
Server component styles keep child combinators (`>`), quotes, and ampersands as written on Next.js 13.5 and 14, whose bundled React 18.3 canary HTML-escaped them inside the inline `<style>` tag (for example `.a > .b`), so the browser dropped those rules on first load. A style value still cannot close the `<style>` tag. Next.js 15 and later were not affected and render the same output as before.
0 commit comments