Skip to content

Latest commit

 

History

History
 
 

babel-plugin-transform-react-jsx

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

babel-plugin-transform-react-jsx

Turn JSX into React function calls

Installation

$ npm install babel-plugin-transform-react-jsx

Usage

Via .babelrc (Recommended)

.babelrc

// without options
{
  "plugins": ["transform-react-jsx"]
}
// with options
{
  "plugins": [
    ["transform-react-jsx", {
      "pragma": "dom" // default pragma is React.createElement
    }]
  ]
}

Via CLI

$ babel --plugins transform-react-jsx script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-react-jsx"]
});