Skip to content

Commit

Permalink
fix lint and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 8, 2024
1 parent 47b67e5 commit 9106093
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/shared/lib/lazy-dynamic/preload-chunks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export function PreloadChunks({
{allFiles.map((chunk) => {
const href = `${requestStore.assetPrefix}/_next/${encodeURI(chunk)}`
const isCss = chunk.endsWith('.css')
// If it's stylesheet we use `precedence` o help hoist with React Float
// If it's stylesheet we use `precedence` o help hoist with React Float.
// For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree.
// The `preload` for stylesheet is not optional.
if (isCss) {
return (
<link
Expand All @@ -54,6 +56,7 @@ export function PreloadChunks({
as: 'script',
fetchPriority: 'low',
})
return null
}
})}
</>
Expand Down

0 comments on commit 9106093

Please # to comment.