Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
80d574ec
Unverified
Commit
80d574ec
authored
Oct 02, 2019
by
Joe Haddad
Committed by
GitHub
Oct 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not mix `null` in `getCssLinks` return value (#8938)
parent
8391d48f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
_document.tsx
packages/next/pages/_document.tsx
+15
-19
No files found.
packages/next/pages/_document.tsx
View file @
80d574ec
...
...
@@ -146,26 +146,22 @@ export class Head extends Component<
getCssLinks
()
{
const
{
assetPrefix
,
files
}
=
this
.
context
.
_documentProps
if
(
!
files
||
files
.
length
===
0
)
{
return
null
}
const
cssFiles
=
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
(
<
link
key=
{
file
}
nonce=
{
this
.
props
.
nonce
}
rel=
"stylesheet"
href=
{
`${assetPrefix}/_next/${encodeURI(file)}`
}
crossOrigin=
{
this
.
props
.
crossOrigin
||
process
.
crossOrigin
}
/>
)
})
return
cssFiles
.
length
===
0
?
null
:
cssFiles
.
map
((
file
:
string
)
=>
{
return
(
<
link
key=
{
file
}
nonce=
{
this
.
props
.
nonce
}
rel=
"stylesheet"
href=
{
`${assetPrefix}/_next/${encodeURI(file)}`
}
crossOrigin=
{
this
.
props
.
crossOrigin
||
process
.
crossOrigin
}
/>
)
})
}
getPreloadDynamicChunks
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment