← All recipes
Moderne licensed

Remove React.forwardRef wrapper

Recipe IDorg.openrewrite.react.19.remove-forward-refArtifact@openrewrite/recipes-react

React.forwardRef is deprecated for Function Components in React 19. This recipe removes the forwardRef wrapper and converts ref to a regular prop.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.react.19.remove-forward-ref

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-react