riot / ssr

Riot.js node Server Side Rendering
MIT License
32 stars 8 forks source link

Usage for entire page #10

Closed bradisbell closed 4 years ago

bradisbell commented 5 years ago

What is the suggested way to render out an entire page?

For example, in my normal Riot.js applications, I have something like this:

index.html

<!doctype html>
<html>
  <head>...</head>
  <body>
    <my-riot-component></my-riot-component>
  </body>
</html>

It's my understanding that we cannot have a Riot.js component at the root of the document, so it seems that it must be nested in some outer HTML. If that's the case, then does the server-side rendering package have a recommended way to incorporate the rendered components back into the outer page?

GianlucaGuarini commented 4 years ago

This feature was added in the new major release https://github.com/riot/ssr#advanced-tips