babel-plugin-react-originjs
v0.0.4
Published
Make react-components into original js
Downloads
11
Readme
babel-plugin-react-originjs
Make react-components into original js
A babel plugin that make react-components into original js.
Before:
ReactDOM.render(<HelloWorld />, document.getElementById('wrap'))
After:
window['ICAT'] && window['ICAT'].react? ICAT.react(function(el){ ReactDOM.render(<HelloWorld />, el); }) : ReactDOM.render(<HelloWorld />, document.getElementById('wrap'));
Installation
$ npm install babel-plugin-react-originjs
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["react-originjs"]
}
Via CLI
$ babel --plugins react-originjs script.js
Via Node API
require('babel-core').transform('code', {
plugins: ['react-originjs']
});
License
MIT