I'm having problems getting mobile metatags into a nextJS app. According to the docs here, this should work https://nextjs.org/docs#populating-head
But I don't see the title or any of my own meta properties getting rendered. All I see is:
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/>
which looks like some type of default.
import Link from 'next/link'
import Head from 'next/head'
import Header from '../components/Header'
import BaseLayout from '../components/BaseLayout.js'
const Index = () => (
<BaseLayout>
<Head>
<title>HSK App</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<Link href='/quizList'>
<h3>HSK Quiz App!</h3>
</Link>
</BaseLayout>
)
export default Index
Help appreciated!
NextJS's
<Head>component seems a bit buggy.For one thing, two
<Head>tags set in different components sometimes will interfere with each other in really bizarre ways. For another, sometimes having it in page components works, sometimes it doesn't. And the rules seems perfectly random.The only thing that consistently worked for me is using
<Head>in_document.js. :/