JSPM

  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q46694F
  • License MIT

Renders diffHTML Virtual Trees to strings

Package Exports

  • diffhtml-render-to-string

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (diffhtml-render-to-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

diffHTML Render To String

Stable Version: 1.0.0-beta.4

Use with diffHTML to render your Virtual Trees to strings. This is useful for server-side rendering and testing.

Installation
npm install diffhtml-render-to-string
Example
import { html } from 'diffhtml';
import renderToString from 'diffhtml-render-to-string';

const markup = renderToString(html`
  <div>Hello world</div>
`);

// Use with something like express to send to the client.
res.send(markup);

This will automatically invoke and render React-like Components. Web Components cannot be hydrated since they are rendered into the Shadow DOM.