babel/packages/babel-plugin-transform-react-jsx
Amjad Masad 3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01dcce69e9d3c0402e96b52b3a2a47ee.
2016-03-03 14:49:20 -08:00
..
2016-03-03 14:49:20 -08:00
2016-03-02 16:29:17 -05:00

babel-plugin-transform-react-jsx

Turn JSX into React function calls

Installation

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

Usage

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