Unverified Commit 80d574ec authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Do not mix `null` in `getCssLinks` return value (#8938)

parent 8391d48f
...@@ -146,26 +146,22 @@ export class Head extends Component< ...@@ -146,26 +146,22 @@ export class Head extends Component<
getCssLinks() { getCssLinks() {
const { assetPrefix, files } = this.context._documentProps const { assetPrefix, files } = this.context._documentProps
if (!files || files.length === 0) { const cssFiles =
return null files && files.length ? files.filter(f => /\.css$/.test(f)) : []
}
return files.map((file: string) => { return cssFiles.length === 0
// Only render .css files here ? null
if (!/\.css$/.test(file)) { : cssFiles.map((file: string) => {
return null return (
} <link
key={file}
return ( nonce={this.props.nonce}
<link rel="stylesheet"
key={file} href={`${assetPrefix}/_next/${encodeURI(file)}`}
nonce={this.props.nonce} crossOrigin={this.props.crossOrigin || process.crossOrigin}
rel="stylesheet" />
href={`${assetPrefix}/_next/${encodeURI(file)}`} )
crossOrigin={this.props.crossOrigin || process.crossOrigin} })
/>
)
})
} }
getPreloadDynamicChunks() { getPreloadDynamicChunks() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment