riot/ssr

No way to render nested without components object?

Closed this issue · 1 comments

Is there no way to render nested without components object?

return await render.default(opts.mount.layout, this.components[opts.mount.layout].default, opts);

This only ever renders the root component, though all other compnents are registered within @riotjs/ssr/register

You can simply do

import { register } from 'riot'
// an index file of all your components as array 
// requireDir or webpack.context will work as well
const components = require('./components')

// register all the components globally
components.forEach(component => {
  riot.register(component.name, component)
})