openameba/react-safety-helmet

Question about streaming

oyeanuj opened this issue · 1 comments

Hi @kouhin! Thank you for creating this library. I had a question about how streaming is being used:

My understanding is that the advantage of streaming is that the server can start sending the code to the client right away. But in the README example, it seems that you are first rendering the app statically, and then sending out the whole html at once. Is there a way to still stream the app as it is being rendered (while still having Helmet work)?

Helmet is used to pick up information such as title, meta from component and put these information into <head> tag.
For example, title. Before rendering the whole content, we can't find out which title will be used finally. But as common streaming render, we must send <head> before <body>.

The only solution may be sending <!doctype html><head> and then rendering the whole app, fetching the data from helmet, and sending the remaining part.