Skip to content

fresk-nc/babel-plugin-transform-jsx-ref-to-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Replace string value of the ref attribute to function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published