next.js
e5a0368a - docs: minor fixes in the next/head doc (#70510)

Commit
1 year ago
docs: minor fixes in the next/head doc (#70510) ### What? Updated the documentation for `next/head` to clarify how `<title>` and `<base>` tags are handled uniquely. Specifically, the documentation states that these tags are automatically checked for duplicates by Next.js and do not require the `key` attribute. ### Why? The current documentation suggests using the `key` attribute to prevent duplicate tags in the `head`. However, `<title>` and `<base>` tags are automatically managed by the `unique` function in Next.js (`head.tsx`), ensuring only one instance is rendered without needing a `key`. This update provides clearer guidance and prevents potential misunderstandings. ### How? - Added a note explaining that `<title>` and `<base>` tags do not need a `key` attribute as they are automatically checked for duplicates by Next.js. ### Reference Source code confirming this behavior: [head.tsx#L85-L93](https://github.com/vercel/next.js/blob/3ead2d1fe98f78307861b12983c76d5a7a88c41a/packages/next/src/shared/lib/head.tsx#L84-L93) <img width="741" alt="Window" src="https://github.com/user-attachments/assets/a3a6f3fd-6aab-48a2-8d15-26df0692b0e1"> Co-authored-by: JJ Kasper <jj@jjsweb.site>
Author
Parents
Loading