babel-plugin-transform-jsx-ref-to-function
v0.0.4
Published
Replace string value of the ref attribute to function
Readme
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-functionAdd this to you babel config plugins
plugins: [
'babel-plugin-transform-jsx-ref-to-function'
]