Find legacy Context API usage
Recipe ID
org.openrewrite.react.19.find-legacy-context-apiArtifact@openrewrite/recipes-reactFinds usage of the legacy Context API (contextTypes, childContextTypes, getChildContext) that was removed in React 19. These must be migrated to React.createContext().
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.find-legacy-context-apiIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-react