Skip to content

Latest commit

 

History

History

styled-components-inner-ref-to-ref

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

styled-components-inner-ref-to-ref

Codemod for easy migration from innerRef to ref.

Usage

Codemods in this repository can be run with the CodeshiftCommunity tooling.

# Transform single file
npx @codeshift/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/path/to/file

# Transform multiple files
npx @codeshift/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/**/*.tsx

Will modify files in place, so make sure you can recover if it goes wrong!

Examples

<div innerRef={this.setRef} />

Is transformed to:

<div ref={this.setRef} />