mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[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
This commit is contained in:
parent
8454a32f3c
commit
d44659744f
|
|
@ -169,7 +169,7 @@ function processLink(props: Object, formatContext: FormatContext): void {
|
|||
return;
|
||||
}
|
||||
case 'stylesheet': {
|
||||
preload(href, 'stylesheet', {
|
||||
preload(href, 'style', {
|
||||
crossOrigin: props.crossOrigin,
|
||||
integrity: props.integrity,
|
||||
nonce: props.nonce,
|
||||
|
|
|
|||
|
|
@ -2087,7 +2087,7 @@ describe('ReactFlightDOM', () => {
|
|||
media="(orientation: landscape)"
|
||||
/>
|
||||
<link rel="modulepreload" href="module-resource" />
|
||||
<link rel="preload" as="stylesheet" href="css-resource" />
|
||||
<link rel="preload" as="style" href="css-resource" />
|
||||
</head>
|
||||
<body>
|
||||
<p>hello world</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user