M

preact/X/preact-import-source-update

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

A codemod that updates imports from Preact to React equivalents and modifies certain Preact imports for compatibility.

Detailed description:
This codemod refactors imports in your codebase to align with React or modern Preact practices. It changes preact-redux imports to react-redux, updates mobx-preact to mobx-react, and ensures that Preact compatibility imports are correctly handled by switching to preact/compat.

Example

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.