React <Helmet> is not updating the meta

Viewed 639

I have created a react app with around 10 components. I have added meta tag using Helmet. But when I inspect source from browser, but meta tag shows some random imdb the rock type thing.
Any suggestions will be appreciated.

<Helmet>
   <meta charSet="utf-8" />
   <title>My Title</title>
   <link name="description" content="some test description" />
</Helmet>
1 Answers

You cannot inspect meta tags from html source, because:

  • html source is static content that javascript cannot touch
  • helmet will create meta tags for you after react javascript has been executed

If you want to check meta tags:

  • Use "Element" tab in developer tool instead of inspect source
  • Use console to check if meta tags exists:

For example, open developer console and you can find link tag as follows:

document.querySelector("link[name=description]");
Related