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
321 stars 23 forks source link

[Question] Usage on create-react-app #38

Closed iamalvisng closed 1 year ago

iamalvisng commented 7 years ago

Does this work in create-react-app without server-side rendering? I dont see changes happened in page source when using this. Can you help me to better understand this?

danieljuhl commented 7 years ago

Yes, it does work (or at least should work) - but obviously not in "view source", but if you inspect your active website, the HTML head should be modified.

If this is not the case, I'm more than willing to look at the issue, if you can provide some more information about your usage.

But most HTML head meta tags only have value if present in the server-side rendered HTML, but if your React app is never "executed" on the server, there is no way for this module to render the meta tags.

dc198689 commented 6 years ago

HI, @danieljuhl In other words, if i using create-react-app to client-side rendering way, there is impossible to dynamic change the meta tag such as facebook scraper meta tag ?

danieljuhl commented 6 years ago

@dc198689 yes, that will be impossible to any library (incase you know a method, and eager to implement!). The reason is, that bots such as Facebooks, doesn't execute the JS, it only download and parse the HTML, and therefor any meta tags needs to be added server-side. When running pure client-side title is basically the only really interesting this to handle.