Skip to content

Commit

Permalink
Update next/head docs to clarify duplicate tags. (#12033)
Browse files Browse the repository at this point in the history
  • Loading branch information
leerob authored Apr 20, 2020
1 parent a6beed0 commit 912f746
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/api-reference/next/head.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ function IndexPage() {
<Head>
<title>My page title</title>
<meta
name="viewport"
content="initial-scale=1.0, width=device-width"
key="viewport"
property="og:title"
content="My page title"
key="title"
/>
</Head>
<Head>
<meta
name="viewport"
content="initial-scale=1.2, width=device-width"
key="viewport"
property="og:title"
content="My new title"
key="title"
/>
</Head>
<p>Hello world!</p>
Expand All @@ -63,7 +63,7 @@ function IndexPage() {
export default IndexPage
```

In this case only the second `<meta name="viewport" />` is rendered.
In this case only the second `<meta property="og:title" />` is rendered. `meta` tags with duplicate `name` attributes are automatically handled.

> The contents of `head` get cleared upon unmounting the component, so make sure each page completely defines what it needs in `head`, without making assumptions about what other pages added.
Expand Down

0 comments on commit 912f746

Please sign in to comment.