riot/ssr

How to render with nested components?

damusix opened this issue · 2 comments

I am trying to render nested components server side, for example:

<myLayout>
    <head is="meta"></head>
    <body>
        { content }
    </body>
</myLayout>

The following:

const Render = require('@riotjs/ssr').default;
const Register = require('@riotjs/ssr/register');

Register();

const name = 'default';
const tmpl = require('./default.riot').default;
const context = { title: 'hello world' }

let content = Render(name, tmpl, context);

Renders this:

<default is="layout"><meta></default>

What if the child component have to be rendered asynchronously?