← All recipes
Moderne licensed

Find React component

Recipe IDorg.openrewrite.react.search.find-react-componentArtifact@openrewrite/recipes-react

Finds all usages of a specific React component including imports, JSX elements, and exports.

Single recipeProprietary

Usage

You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.react.search.find-react-component --recipe-option "componentName=Button"

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

mod config recipes npm install @openrewrite/recipes-react

Options

NameTypeDescription
componentNamerequiredThe name of the React component to find (e.g., 'Button', 'TextField')
e.g. Button
importPathOptional module path to narrow the search (e.g., '@mui/material'). Supports glob patterns.
e.g. @mui/material