-
Notifications
You must be signed in to change notification settings - Fork 660
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
Streaming SSR #322
Comments
With React 15.x using React-Helmet, since I stream the document head for prefetching before performing any SSR work, my work around was to cache the meta tags / title results from react-helmet after render. Is there a way to rewrite head later in the document? |
Nopesies, the browser already has that part so you can't change it anymore. That's what this issue is about... 😉 |
Looks like PR #296 addresses part of the issue with streaming a response. |
Dupe of #216 |
I have released react-router-metadata, internally it uses a modified version of react-helmet. I realize that this can only be used with react router config v4, so it's definitely not an alternative unless you're using react-router-config. To support streaming, instead of defining metadata in the However, it uses react-html-metadata to provide the Hope this helps someone |
Looks like in HTML5 it is fine to omit the and . In theory would it be possible to have something resemble. `
<!doctype html>
${ReactDOM.renderToNodeStream(...App)}
${helmet.title.toString()}
${helmet.meta.toString()}
${helmet.link.toString()}
` |
I'm using https://github.com/NYTimes/react-helmet-async very happily! |
React 16 introduced streaming server-side rendering, allowing Node servers to improve the TTFB and respond better to backpressure. Unfortunately, how react-helmet works at the moment it doesn't lend itself to streaming at all since the
document.head
is already at the client by the time helmet knows what meta tags to inject.I wanted to kick off a discussion about how dynamic meta tags could work in this new streaming world. Has anybody given this any thought?
The text was updated successfully, but these errors were encountered: