-
Notifications
You must be signed in to change notification settings - Fork 26.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<Head /> Titles Are Blank #5774
Comments
Maybe this happens because Have you tried with Title.js calling next/head directly itself ? import Head from 'next/head'
export default ({ title }) => (
<Head>
<title>
{`${title} | My Awesome Website`}
</title>
</Head>
) And removing Head from Page.js : import Title from './Title'
const Page = props => (
<div>
<Title title={props.title} />
{props.children}
</div>
)
export default Page |
You're right. Since |
@geirman |
Ah, that makes sense. Thanks for the explanation! |
Bug report
Describe the bug
Bug #5635 was closed as a duplicate of #5628, but I don't think it actually was a duplicate. I can see why you'd think so at first glance though. Both seem to be related to the Fragment tag's usage, but at least for the case of #5635, I think that was a coincidence because the problem described there is something I'm also seeing.
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
git clone https://github.com/geirman/nextjs-title-bug
cd nextjs-title-bug
Yarn
(duh!)npm run dev
Note
that the expected title flashes briefly, then becomes empty.Note
the server rendered title persists as expectedExpected behavior
The server rendered title should persist even after the client script is run
Screenshots
System information
Additional context
So you don't have to go through the repo code...here's a copy/paste of the relevant pages.
Page.js
Title.js
/pages/index.js used like so...
The text was updated successfully, but these errors were encountered: