babel-plugin-transform-react-available-component
v0.1.0
Published
A plugin for babel provides s simple way to control react component/element display by porps
Downloads
1
Readme
babel-plugin-transform-react-available-component
A plugin for babel provides s simple way to control react component/element display by porps
Example
In
<div available="foo"></div>
Out
available("foo") ? React.createElement("div", null) : null
Installation
$ npm install babel-plugin-transform-react-available-component
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-react-available-component"]
}
Via CLI
$ babel --plugins transform-react-available-component script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-react-available-component"]
});