← All recipes
Moderne licensed

Simplify React.xxx to direct imports

Recipe IDorg.openrewrite.react.simplify-react-importsArtifact@openrewrite/recipes-react

Converts React.useState, React.useEffect, and other React namespace accesses to direct named imports.

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.simplify-react-imports

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

mod config recipes npm install @openrewrite/recipes-react