Closed sarimabbas closed 4 years ago
Thanks for all the details! I'm doubting that this is a problem with MDX, rather, maybe you'll have more luck in the Next direction?
You might have better luck with the next-mdx-enhanced plugin. You can set the title in the frontmatter (which is a nicer user interface anyway) and specify it to be taken in as the title in a layout you create. I've got a website set up with this technique and I don't get the issue you are facing.
I'll give that a try, thank you!
Subject of the issue
I'm using
<Head>
from "next/head" to set page titles. It works well on my normal.tsx
pages. But in.mdx
pages, the title is only set for a split second when loading the page before it reverts to "localhost". Which is why I'm posting here on the MDX repo.Here is some code:
The title shows up in the source code, just not in the browser tab.
Strangely, when I remove the
is not registered with MDXProvider.<Head>
import, the title persists, but then I get a warning thatYour environment
Steps to reproduce
.mdx
file inpages
next/head
and use it to set a title