Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.31 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.31 KB

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
});