@shopify/react-html
Version:
A component to render your React app with no static HTML
13 lines (10 loc) • 349 B
JavaScript
import { Readable } from 'stream';
import { renderToStaticNodeStream } from 'react-dom/server';
import multistream from 'multistream';
function stream(tree) {
const doctype = new Readable();
doctype.push('<!DOCTYPE html>');
doctype.push(null);
return multistream([doctype, renderToStaticNodeStream(tree)]);
}
export { stream as default };