Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/packages / libraries / react-server / serverSideRender / renderWithoutServerSide.js
Size: Mime:
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