Codemod for easy migration from innerRef to ref.
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!
<div innerRef={this.setRef} />
Is transformed to:
<div ref={this.setRef} />