grunt-html2jsx
v1.0.5
Published
Converts HTML to JSX for use with React.
Downloads
16
Maintainers
Readme
grunt-html2jsx
Converts HTML to JSX for use with React.
Install
$ npm install --save-dev grunt-htmltojsx
Usage
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
htmltojsx: {
options: {
includeRuntime: true
},
dist: {
files: {
'dist/main.js': 'src/main.js'
}
}
}
});
grunt.registerTask('default', ['htmltojsx']);
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