@babel/plugin-transform-react-jsx-self
NOTE: This plugin is included in
@babel/preset-react
Example
In
<sometag />
Out
<sometag __self={this} />
Installation
npm install --save-dev @babel/plugin-transform-react-jsx-self
Usage
With a configuration file (Recommended)
{
"plugins": ["@babel/plugin-transform-react-jsx-self"]
}
Via CLI
babel --plugins @babel/plugin-transform-react-jsx-self script.js
Via Node API
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-transform-react-jsx-self"],
});