Remove implicit ref callback returns
Recipe ID
org.openrewrite.react.19.no-implicit-ref-callback-returnArtifact@openrewrite/recipes-reactIn React 19, ref callbacks can return cleanup functions. Arrow functions with expression bodies implicitly return values, which React would interpret as cleanup functions. This recipe wraps them in block bodies.
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.no-implicit-ref-callback-returnIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-react