You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use React.renderComponentToString(component) in React you can prerender the DOM to html in such way that you can send the pre-rendered HTML to the client and then 'hook' to the pre-rendered DOM as if it was generated on the client itself.
You can even take this a step further with the ReactAsync package and do stuff like XHR on the serverside aswell and prerender those elements that depend on asynchronously loaded content into the DOM.
You are right, this is a great feature of React and I'm definitely planning on taking a crack at it! One of the advantages of the tagless-final style is you can re-interpret the same expressions in different contexts-- I'm planning on making a "server side" context that takes your views and generates static content (possibly via blaze-html etc).
I didn't know about ReactAsync though. that's a cool idea and definitely worth looking into.
ReactAsync is intended for the cases where it is extremely necessary to perform async state generation, and as the disclaimer says in the README, it is not something you should build apps off of.
When you use
React.renderComponentToString(component)
in React you can prerender the DOM to html in such way that you can send the pre-rendered HTML to the client and then 'hook' to the pre-rendered DOM as if it was generated on the client itself.You can even take this a step further with the ReactAsync package and do stuff like XHR on the serverside aswell and prerender those elements that depend on asynchronously loaded content into the DOM.
Example: https://github.com/andreypopp/react-quickstart
I was wondering if something like this would be worth exploring in shade. It would be extremely cool.
The text was updated successfully, but these errors were encountered: