nfl / react-helmet

A document head manager for React
MIT License
17.34k stars 660 forks source link

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

Open kopax-polyconseil opened 3 years ago

kopax-polyconseil commented 3 years ago

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 !

josh-feinstein commented 3 years ago

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

headElement.prepend(newChild)

askibinski commented 2 years ago

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

haresh6x commented 2 years ago

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.