Socket
Book a DemoInstallSign in
Socket

gulp-html2jsx

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-html2jsx

Converts HTML to JSX for use with React

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

gulp-react Build Status

Converts HTML to JSX for use with React.

Install

$ npm install --save-dev gulp-html2jsx

Usage

var gulp = require('gulp');
var html2jsx = require('gulp-html2jsx');

gulp.task('default', function () {
	return gulp.src('template.html')
		.pipe(html2jsx({/* if any opts */}))
		.pipe(gulp.dest('dist'));
});

API

html2jsx(options)

options:

{
  createClass: true,
  outputClassName: 'AwesomeComponent'
}

Sample:

<p> Hello </p>

Get converted to:

var NewComponent = React.createClass({
  render: function() {
    return (

      <p> Hello </p>
    );
  }
});

License

MIT © Hemanth.HM

Keywords

gulpplugin

FAQs

Package last updated on 28 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts