nfl / react-helmet

A document head manager for React
MIT License
17.38k stars 661 forks source link

Adding partial Helmet tags remove previous tags. #309

Open tiagojsalmeida opened 7 years ago

tiagojsalmeida commented 7 years ago

Hey all!

First of all thank for making this amazing tool!

We are using Helmet at HelloFresh in production and we've found a possible issue that is affecting our customer.

We have multiple Helmet tags, some of them inject styles, others inject meta properties. We also have server side rendering so consider this example:

https://codesandbox.io/s/n5ANnBrY4

I'm basically injecting a style tag so assume that it comes from SSR. Then, if my application has a Helmet tag, this previous rendered style tag is being deleted from here.

Do you guys reckon that this is a Helmet issue or a bad usage from our part? Shouldn't it delete old tags only if tags.length > 0?

Thanks, Tiago Almeida

biddlem commented 7 years ago

I am experiencing the same behavior. We have a React application that is loading other remote react components, and those remote components have a Helmet tag with stylesheets/etc that they want injected onto the page. Is there any recommended guidance on how to achieve this?

tiagojsalmeida commented 7 years ago

@biddlem We are doing exactly the same. You can read a bit of our implementation in here.

j-arb commented 2 weeks ago

Same issue here. Any follow-up on this?