Open m-a-r-c-e-l-i-n-o opened 6 years ago
Not sure if you are aware but https://github.com/staylor/react-helmet-async exists which I think addresses some of your issues.
Seems like this is an ongoing theme. I might have missed it but is there a public repo I can fork?
I would like to investigate further and it would same me some time if it was easily repo'd.
I'm also open to a PR. Let's talk about the implementation details first? Maybe I can open a public slack or gitter.
@tmbtech FWIW We've moved over to using react-helmet-async. Maybe reach out to them and talk about moving the changes from the fork over here.
Maybe I've been doing server side rendering with Helmet the wrong way and if that is the case, please correct me. It's my understanding that the only way to get the values from Helmet during server side rendering is to call the "Helmet.renderStatic()" method from the "Helmet" global after the components are rendered.
There are two major issues with this approach:
Is there any reason we can't use the "provider" approach for server side rendering? I can probably submit a PR if you guys are okay with the approach. Here's an example of how that looks: (https://material-ui.com/guides/server-rendering/#server-rendering). This approach is also seen in other libraries that have a server side rendering component (e.g. Redux).