nfl / react-helmet

A document head manager for React
MIT License
17.28k stars 657 forks source link

Hreflang link (SSR) is in camelCase #651

Open Tomas2D opened 2 years ago

Tomas2D commented 2 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? Helmet.renderStatic() (SSR) produces different output than in SPA.

// App.jsx
...
<Helmet>
      <link rel="alternate" hrefLang={"en"} href={"https://example.com"} />
</Helmet>
...
// HTML from SSR
<link data-react-helmet="true" rel="alternate" **hrefLang**="en" href="https://example.com"/>
// HTML after hydration
<link data-react-helmet="true" rel="alternate" **hreflang**="en" href="https://example.com"/>

Hreflang should be in lowercase, not in camelCase.

Minimal demo of the problem

GitHub repository

What is the expected behavior?

Helmet.renderStatic() for links (Helmet.renderStatic().link.toString()) should give same result as user gets after hydratation.

Which versions of React and react-helmet, and which browser / OS are affected by this issue?

react-helmet: 6.1.0 react: 17.0.2

Tomas2D commented 2 years ago

Any progress on this?

Tomas2D commented 1 year ago

bump