noHeadImportInDocument
此内容尚不支持你的语言。
Diagnostic Category: lint/nursery/noHeadImportInDocument
Since: v1.9.4
Sources:
- Same as:
@next/no-head-import-in-document
Prevent using the next/head
module in pages/_document.js
on Next.js projects.
Importing next/head
within the custom pages/_document.js
file can cause
unexpected behavior in your application. The next/head
component is designed
to be used at the page level, and when used in the custom document it can interfere
with the global document structure, which leads to issues with rendering and SEO.
To modify <head>
elements across all pages, you should use the <Head />
component from the next/document
module.