Replace useContext with use
Recipe ID
org.openrewrite.react.19.use-context-hookArtifact@openrewrite/recipes-reactIn React 19, useContext is replaced by the use API. This recipe updates both direct and namespace 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.19.use-context-hookIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-react