Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
React
migration
bycodemod.com
Replace String Ref
Made for
React
Last update
May 8, 2024
This codemod migrates string refs (deprecated) to callback refs.
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