Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
migration
by
Codemod
React/19/Remove Forward Ref
Last update
Apr 15, 2025
React.forwardRef will be deprecated for Function Components in near future. This codemod removes forwardRef function.
Before:
import { forwardRef } from "react";const MyInput = forwardRef(function MyInput(props, ref) {// ...});
After:
const MyInput = function MyInput({ ref, ...props }) {// ...};
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community