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,16 +146,12 @@ export class Head extends Component< ...@@ -146,16 +146,12 @@ 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) => {
// Only render .css files here
if (!/\.css$/.test(file)) {
return null
}
return cssFiles.length === 0
? null
: cssFiles.map((file: string) => {
return ( return (
<link <link
key={file} key={file}
......
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