/render-glamorous

Render a Glamorous React component as static html, useful for visual regression tests

Primary LanguageJavaScript

render-glamorous

Travis npm package Coveralls

Render a Glamorous React component as static html, useful for visual regression tests.

Originally built for use with component-image.

Usage

npm i -D render-glamorous

import renderGlamorous from 'render-glamorous';
import MyComponent from './components/my-component';

const htmlString = renderGlamorous(MyComponent); // returns static html markup with inline CSS

With component-image

npm i -D render-glamorous component-image

import { generateImage } from 'component-image';
import renderGlamorous from 'render-glamorous';
import MyComponent from './components/my-component';

generateImage(MyComponent, {
  renderer: renderGlamorous
}).then(image => {
  // do something
});