React
migration
byCodemod

React/19/Remove Forward Ref

/icons/calendar.svg

Last update

Sep 29, 2024

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

background illustrationGet Started Now