Open cdebotton opened 6 years ago
Since ReactDOM can now render to a readable stream, this will let us properly return that as the type for the HTML value.
ie)
const { html, css } = renderStatic(() => renderToNodeStream(app)); ctx.respond = false; ctx.status = 200; ctx.res.write( '<!doctype html>' + '<html lang="en">' + '<head>' + `<style>${css}</style>` + '</head>' + '<body>' + '<main id="app">', ); html .on('end', () => { ctx.res.end( '</main>' + '</body>' + '</html>', ); }) .pipe(ctx.res); };
Since ReactDOM can now render to a readable stream, this will let us properly return that as the type for the HTML value.
ie)