React
migration
byCodemod

React/19/Replace String Ref

/icons/badge-info.svg

Made for

React

/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