Preact/X/Preact Import Source Update

/icons/calendar.svg

Last update

Aug 21, 2024

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

import { Provider } from 'preact-redux';
import { observer } from 'mobx-preact';
import { render } from 'preact-compat';

After

import { Provider } from 'react-redux';
import { observer } from 'mobx-react';
import { createPortal } from 'preact/compat';
import { render } from 'preact/compat';

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now