'use strict' const { h } = require('preact') const { render } = require('preact-render-to-string') module.exports = function (Component, Master) { const locals = Object.assign({}, this.app.locals, this.locals) let html if (!html && typeof Component === 'function') { html = render(h(Component, locals)) } // always render master, since shim mw will add // scripts depending on user agent string if (typeof Master === 'function') { html = Master(Object.assign({ html }, locals)) } this.send(html) }