Skip to content

Instantly share code, notes, and snippets.

@kronaemmanuel
Created June 13, 2020 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kronaemmanuel/8e777eaf29bb961d9bda4c8bd08a314f to your computer and use it in GitHub Desktop.
Save kronaemmanuel/8e777eaf29bb961d9bda4c8bd08a314f to your computer and use it in GitHub Desktop.
Next Head's basic usage
import Head from { next/head }
// A high level App component
const App = () => {
return(
<Head>
// Page will have "My App" as its title initially
<meta property="title" content="My App" key="title" />
</Head>
<Details />
)
}
// A component inside App component
const Details = () => {
return(
<Head>
//Page will now have "Details" as its title because this overwrites its previous meta tag which has the same key
<meta property="title" content="Details" key="title" />
</Head>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment