silverwolf-x/project / errors /no-title-in-document-head.mdx
silverwolf-x's picture
download
raw
848 Bytes
---
title: No Title in Document Head
---
> Prevent usage of `<title>` with `Head` component from `next/document`.
## Why This Error Occurred
A `<title>` element was defined within the `Head` component imported from `next/document`, which should only be used for any `<head>` code that is common for all pages. Title tags should be defined at the page-level using `next/head` instead.
## Possible Ways to Fix It
Within a page or component, import and use `next/head` to define a page title:
```jsx filename="pages/index.js"
import Head from 'next/head'
export function Home() {
return (
<div>
<Head>
<title>My page title</title>
</Head>
</div>
)
}
```
## Useful Links
- [next/head](/docs/pages/api-reference/components/head)
- [Custom Document](/docs/pages/building-your-application/routing/custom-document)

Xet Storage Details

Size:
848 Bytes
·
Xet hash:
baca90619d5262b5b346b6fa64f0ae5a43f8d1d021132fd357f0a77d227c0573

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.