react-helmet icon indicating copy to clipboard operation
react-helmet copied to clipboard

How to inject the <meta /> at the top of the <head /> in react-helmet v6 ?

Open kopax-polyconseil opened this issue 4 years ago • 3 comments

Hi, I want to inject my social networks meta at the top of the head (og:title, ...), so far it keep being injected at the end.

How can I configure react-helmet to inject at the top?

Thanks a lot !

kopax-polyconseil avatar Aug 25 '21 09:08 kopax-polyconseil

I was able to accomplish this by replacing "appendChild" with "prepend" within the Helmet.js file.

headElement.prepend(newChild)

josh-feinstein avatar Aug 31 '21 17:08 josh-feinstein

Related: https://github.com/nfl/react-helmet/issues/514

askibinski avatar Jan 11 '22 14:01 askibinski

I was able to accomplish this by replacing "appendChild" with "prepend" within the Helmet.js file.

headElement.prepend(newChild)

I did this like in the image but no luck :(

image

Update: oops! I was modifying Helmet.js in lib folder. I had to modify it in es folder.

haresh6x avatar Apr 22 '22 09:04 haresh6x