byCodemod

Mui/Named Import To Direct Import

/icons/calendar.svg

Last update

Jun 17, 2024

Updates named imports from MUI icons to direct imports.

Example

Before

import {
AccessAlarm as AccessAlarmIcon,
ThreeDRotation as NiceIcon,
} from '@mui/icons-material';
export function MuiDemo({ title }: { title: string }) {
return (
<>
{title}
<AccessAlarmIcon />
<NiceIcon />
</>
);
}
export default MuiDemo;

After

import AccessAlarmIcon from '@mui/icons-material/AccessAlarm';
import NiceIcon from '@mui/icons-material/ThreeDRotation';
export function MuiDemo({ title }: { title: string }) {
return (
<>
{title}
<AccessAlarmIcon />
<NiceIcon />
</>
);
}
export default MuiDemo;

Build custom codemods

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

background illustrationGet Started Now