React
migration
byalexbit-codemod

React/19/Replace String Ref

/icons/calendar.svg

Last update

Jul 24, 2024

This codemod migrates string refs (deprecated) to callback refs.

Example

Before:

< div ref = 'refName' / > ;

After:

< div ref = { ref => this.refs.refName = ref }
/>

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now