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    
Size: Mime:
import { renderToString } from 'react-dom/server'
import serialize from 'serialize-javascript'

export function renderFinalString(html: JSX.Element) {
  // @note this was renderToStaticMarkup
  const appString = renderToString(html)

  if (process.env.IS_SSR_TEST) {
    const stringScript = `<script>window.__SSR_STRING__=${serialize(
      appString
    )}</script>`
    const output = appString + stringScript
    return output
  } else {
    return appString
  }
}