← All recipes
Moderne licensed

Convert class components to functional components

Recipe IDorg.openrewrite.react.refactoring.class-to-functionalArtifact@openrewrite/recipes-react

Converts simple render-only class components to functional components.

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.refactoring.class-to-functional

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

mod config recipes npm install @openrewrite/recipes-react