Repository URL to install this package:
|
Version:
0.0.15 ▾
|
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { logger } from '../log';
import { ServerHTML } from './HTML';
export function renderWithoutServerSide(res, nonce) {
if (process.env.DISABLE_SSR === 'true') {
logger.warn('[SSR] ==> Handling react route without SSR');
}
// SSR is disabled so we will return an "empty" html page and
// rely on the client to initialize and render the react application.
const html = renderToStaticMarkup(React.createElement(ServerHTML, { nonce: nonce, reactAppString: "", styledTags: [] }));
res.status(200).send(`<!DOCTYPE html>${html}`);
res.end();
}
//# sourceMappingURL=renderWithoutServerSide.js.map