← All recipes
Moderne licensed

Replace act import from react-dom/test-utils

Recipe IDorg.openrewrite.react.19.replace-act-importArtifact@openrewrite/recipes-react

In React 19, act has been moved from react-dom/test-utils to react. This recipe updates the import statement.

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.replace-act-import

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

mod config recipes npm install @openrewrite/recipes-react