0.0.4 • Published 8 years ago
babel-plugin-transform-jsx-ref-to-function v0.0.4
babel-plugin-transform-jsx-ref-to-function
Replace string value of the ref attribute to function.
Example
In
<button ref="button">Some button</button>
Out
<button ref={el => this['button'] = el}>Some button</button>
Installation
$ npm i --save-dev babel-plugin-transform-jsx-ref-to-function
Add this to you babel config plugins
plugins: [
'babel-plugin-transform-jsx-ref-to-function'
]