Skip to content

holodex/gulp-react-render

 
 

Repository files navigation

gulp-render-react Build Status

Render React components to string or static markup

Will render React component with React.renderToString or React.renderToStaticMarkup

Install

$ npm install --save-dev gulp-render-react

Usage

var gulp = require('gulp');
var render = require('gulp-render-react');

var SRC = 'src/*.jsx';
var DEST = 'dist';

gulp.task('default', function () {
  return gulp.src(SRC, { read: false })
    .pipe(render('string', {
      some: 'default'
      props: 'to',
      pass: 'on'
    }))
    .pipe(gulp.dest(DEST));
});

API

render(type, props)

  • type is
    • string for React.renderToString()
    • markup for React.renderToStaticMarkup()
  • props are the properties to create the component with

License

MIT © Andrew Shapro

About

Render react components to string or static markup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%