Closed damusix closed 5 years ago
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>
And voilà https://codesandbox.io/s/riotjs-4-simple-ssr-h6lyo
What if the child component have to be rendered asynchronously?
I am trying to render nested components server side, for example:
The following:
Renders this: