Ccodemod-com-bot

react-new/update-react-imports

Remove unused React default import and convert to named imports

React
Private
0 executions
Run locally
npx codemod @react-new/update-react-imports
Documentation

update-react-imports

Remove unnecessary React imports, convert member access to named imports when safe, and keep namespace imports when React is used as a value or type namespace.

Usage

bash

Options

  • destructureNamespaceImports: allow namespace imports such as import * as React to be destructured into named imports when it is safe to do so.

Development

bash

Ready to contribute?

Build your own codemod and share it with the community.