gulp-html2jsx
v1.0.3
Published
Converts HTML to JSX for use with React
Downloads
63
Maintainers
Readme
gulp-react
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