← All recipes
Moderne licensed

Convert manual .bind(this) to arrow functions

Recipe IDorg.openrewrite.react.refactoring.manual-bind-to-arrowArtifact@openrewrite/recipes-react

Converts this.method = this.method.bind(this) in constructors to class field arrow function syntax.

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.refactoring.manual-bind-to-arrow

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

mod config recipes npm install @openrewrite/recipes-react