Syntax only
This plugin only allows Babel to parse this syntax. If you want to transform it then see transform-react-jsx.
This plugin allows Babel to parse JSX.
npm install --save-dev babel-plugin-syntax-jsx
.babelrc
(Recommended).babelrc
{
"plugins": ["syntax-jsx"]
}
babel --plugins syntax-jsx script.js
require("babel-core").transform("code", {
plugins: ["syntax-jsx"]
});