kodyl / react-document-meta

HTML meta tags for React-based apps. Works for both client- and server-side rendering, and has a strict but flexible API.
MIT License
320 stars 23 forks source link

Title is getting set as an empty string #41

Closed casschin closed 6 years ago

casschin commented 7 years ago

I'm using this library to add some tags to a page and I noticed that my page title was being set to an empty string, even though I was using the extend prop.

I got around this by setting the title again when rendering the <DocumentMeta /> component with this meta object:

const meta = {
    title: document.title,
    link: {
        ...
    }
}

I was looking at the source code and saw this line. Is there a reason why it sets the title to an empty string?

danieljuhl commented 6 years ago

Just one quick question... you are setting the document title initially during SSR, and then you don't have any title (besides the workaround) in your client-side code, correct?

I'm added a regression test for the case, and needs to know if I have found the correct case

danieljuhl commented 6 years ago

@casschin this has been published in v3 beta