Socket
Book a DemoInstallSign in
Socket

grunt-html2jsx

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-html2jsx

Converts HTML to JSX for use with React.

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

grunt-html2jsx Build Status

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

Keywords

gruntplugin

FAQs

Package last updated on 05 Apr 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