/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/no-head-element.mdx
34 строки
707 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: No Head Element --- > Prevent usage of `<head>` element. ## Why This Error Occurred A `<head>` element was used to include page-level metadata, but this can cause unexpected behavior in a Next.js application. Use Next.js' built-in `next/head` component instead. ## Possible Ways to Fix It Import and use the `<Head />` component: ```jsx filename="pages/index.js" import Head from 'next/head' function Index() { return ( <> <Head> <title>My page title</title> <meta name="viewport" content="initial-scale=1.0, width=device-width" /> </Head> </> ) } export default Index ``` ## Useful Links - [next/head](/docs/pages/api-reference/components/head)