mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Make <Head>
children render first, then next/head children, then script preloads/styles (#5852)
This commit is contained in:
parent
93424b64a9
commit
1c8b09d7ea
|
@ -120,6 +120,7 @@ export class Head extends Component {
|
|||
}
|
||||
|
||||
return <head {...this.props}>
|
||||
{children}
|
||||
{head}
|
||||
{page !== '/_error' && <link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages${pagePathname}`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} />}
|
||||
<link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages/_app.js`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} />
|
||||
|
@ -128,7 +129,6 @@ export class Head extends Component {
|
|||
{this.getPreloadMainLinks()}
|
||||
{this.getCssLinks()}
|
||||
{styles || null}
|
||||
{children}
|
||||
</head>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue