react-meta-tags
react-meta-tags copied to clipboard
re: Define id on tags so if you navigate to other page, older meta tags will be removed and replaced by new ones.
Hi,
First thank you for providing this meta tag module. I am probably one of several people trying to implement SEO-friendly pre-rendered React to serve from static hosting.
By the
Note: Define id on tags so if you navigate to other page, older meta tags will be removed and replaced by new ones.
should I add identical id's to tags that should be replaced?
For instance if I have the following in my index.html
<meta id="og-title-meta-tags" property="og:title" content="original title" />
Would I have the following in a index.js file?
<meta id="og-title-meta-tags" property="og:title" content="new title" />
Also an off topic question - are all tags that can be used in
possible to be used? i.e.) etc.?Thank you for your reply.
+1 for this, it's not clear how it can be implemented. e.g. in my testing I have multiple application routes, but on loading each one, the application will add a new script tag in the head without destroying the old one. I suspect I'll need to work with the componentWillUnmount() lifecycle method and destroy any meta-tag child components, but it would be nice if this was already bundled into react-meta-tags.
It's been a while since this issue was created but if you still need an answer, it seems to be the case that you need identical IDs for each "page". This will remove the old tags that have same IDs.