Ccodemod-com-bot

react-new/manual-bind-to-arrow

Convert this.method = this.method.bind(this) to arrow class property

React
Private
0 executions
Run locally
npx codemod @react-new/manual-bind-to-arrow
Documentation

manual-bind-to-arrow

Convert constructor-time .bind(this) assignments into arrow class fields.

Usage

bash

Development

bash
Before

This is one example from the codemod's test cases. The codemod may handle many more cases.

Ready to contribute?

Build your own codemod and share it with the community.