6.22.1 • Published 2 years ago
babel-plugin-transform-dulcet-jsx-self v6.22.1
babel-plugin-transform-dulcet-jsx-self
Adds
__self
prop to JSX elements, which Dulcet will use to generate some runtime warnings. All Dulcet users should enable this transform in dev mode.Example
In
<sometag />
Out
<sometag __self={this} />
Installation
npm install --save-dev babel-plugin-transform-dulcet-jsx-self
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-dulcet-jsx-self"]
}
Via CLI
babel --plugins transform-dulcet-jsx-self script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-dulcet-jsx-self"]
});