← All recipes
Moderne licensed

Upgrade to React 17

Recipe IDorg.openrewrite.react.migrate.upgrade-to-react-17Artifact@openrewrite/recipes-react

Migrate deprecated APIs for React 17 compatibility. Includes all React 16 migrations plus lifecycle method prefixing, import cleanup, and event.persist() removal.

Composite 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.migrate.upgrade-to-react-17

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

mod config recipes npm install @openrewrite/recipes-react

Definition

This recipe runs the following recipes in order.