Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place meta charset output at top of head #239

Open
tinynumbers opened this issue Feb 16, 2017 · 6 comments · May be fixed by #484
Open

Place meta charset output at top of head #239

tinynumbers opened this issue Feb 16, 2017 · 6 comments · May be fixed by #484
Labels

Comments

@tinynumbers
Copy link

According to the HTML5 specification,

The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document.

However, as far as I can tell, react-helmet makes no attempt to output any configured <meta charset='...'> tag as the first thing in the <head> element; in fact it appears to always be output after the <title>. If other code is also writing to the <head> (e.g. styled-components), this could push the charset specification well past that 1024 byte cutoff.

Is it possible to modify the output order of the head elements produced by react-helmet?

@cwelch5
Copy link
Contributor

cwelch5 commented Mar 5, 2017

@tinynumbers on the server side, you can control the ordering of groups of head information (i.e. meta tags before title tag before link tags). And the ordering of tags should stay the same order they were given as props to Helmet. On the client, you're right, the code doesn't try to maintain this order. We can look into fixing that. Thanks!

@cwelch5 cwelch5 added the bug label Mar 5, 2017
@damianobarbati
Copy link

+1 for this: I'm prerendering my page with puppeeter but title is placed below the styling thus google does not find it.

@ridoansaleh
Copy link

Have anyone solved this issue ?

@oxynad
Copy link

oxynad commented Jun 14, 2018

Bump, still no solution to this issue.
Would help greatly with prerenderers such as puppeeter.

@rajqumar
Copy link

Any solution yet for this ??

@Elyx0
Copy link

Elyx0 commented Oct 15, 2021

So to this day the only solution to this is still https://github.com/jimmay5469/react-helmet/tree/feature/placement ? What's up with that. I can't believe no one worked around that in 4 years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants