Replace defaultProps with default parameter values
Recipe ID
org.openrewrite.react.19.replace-default-propsArtifact@openrewrite/recipes-reactConverts Component.defaultProps = {...} to ES6 default parameter values in function components. defaultProps for function components is deprecated in React 19.
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.replace-default-propsIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-react