I've been setting my react.js SPA's page titles by doing:
document.title = {some title}
...so far and it worked fine. Now, I also wanted to update the meta
title
tag and so I installed react-helmet.
In my component, I've imported Helmet
from the library and did:
render() {
{/* ... */}
return (
<div>
<Helmet>
<title>{docTitle}</title>
<meta name="title" content={docTitle} />
</Helmet>
{/* ... */}
</div>
)
}
When opening the page, I saw that the document title is properly updated, but when inspecting the elements in the browser, I noticed that <meta name="title"
is not being updated, while a few lines down, <title>
is updated.
What am I doing wrong here?