0.0.4 • Published 7 years ago

babel-plugin-transform-jsx-ref-to-function v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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'
]