Closed avin-kavish closed 2 years ago
Hey @avin-kavish, I can't say I am super familiar with SSR but I think you'll still need to render the css string in a <style>
tag in the head of the page, and render the hydration script in the body (both supplied by extractStyles
), similar to the NextJS example. The hydration script is a React component instance, so you'll probably need to call renderToString
on it when returning the HTML to the client.
How do I write SSR in just plain node.js?
I guess styles have to built somewhere here? Should I use the non-stream version instead? i.e.
renderToString