Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 604 Bytes

File metadata and controls

44 lines (33 loc) · 604 Bytes

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"]
});