Created
June 13, 2020 09:50
-
-
Save kronaemmanuel/8e777eaf29bb961d9bda4c8bd08a314f to your computer and use it in GitHub Desktop.
Next Head's basic usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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