C

react/prop-types-typescript

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Codemod to convert React PropTypes to TypeScript types.

  • Supports function and class components
  • Supports static propTypes declarations on class components
  • Supports forwardRefs
  • Supports files with multiple components
  • Copies JSDoc comments to the generated TypeScript types
  • Option to remove or preserve PropTypes after converting to TS

Before:

jsx

After:

tsx

Ready to contribute?

Build your own codemod and share it with the community.