@samitouri / QOS-React-2 / commits / d44659744f

[Flight] Fix preload `as` attribute for stylesheets (#34760)

Follow-up to #34604. For a stylesheet, we need to render `<link rel="preload" as="style" ...>`, and not `<link rel="preload" as="stylesheet" ...>`. ([ref](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preload#what_types_of_content_can_be_preloaded)) fixes vercel/next.js#84569

Hendrik Liebau committed Oct 10, 2025 at 21:40 UTC d44659744fd09736793c73e93ea79048f45570ea
2 files changed +2 -2
packages/react-dom-bindings/src/server/ReactFlightServerConfigDOM.js
+1 -1
@@ -169,7 +169,7 @@ function processLink(props: Object, formatContext: FormatContext): void {
169 return;
170 }
171 case 'stylesheet': {
172 - preload(href, 'stylesheet', {
172 + preload(href, 'style', {
173 crossOrigin: props.crossOrigin,
174 integrity: props.integrity,
175 nonce: props.nonce,
packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js
+1 -1
@@ -2087,7 +2087,7 @@ describe('ReactFlightDOM', () => {
2087 media="(orientation: landscape)"
2088 />
2089 <link rel="modulepreload" href="module-resource" />
2090 - <link rel="preload" as="stylesheet" href="css-resource" />
2090 + <link rel="preload" as="style" href="css-resource" />
2091 </head>
2092 <body>
2093 <p>hello world</p>