← All recipes
Moderne licensed

Find legacy Context API usage

Recipe IDorg.openrewrite.react.19.find-legacy-context-apiArtifact@openrewrite/recipes-react

Finds 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-api

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

mod config recipes npm install @openrewrite/recipes-react