Files
react-test/packages/mui-codemod/src/deprecations/backdrop-props/backdrop-props.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
737 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import movePropIntoSlots from '../utils/movePropIntoSlots';
import replaceComponentsWithSlots from '../utils/replaceComponentsWithSlots';
/**
* @param {import('jscodeshift').FileInfo} file
* @param {import('jscodeshift').API} api
*/
export default function transformer(file, api, options) {
const j = api.jscodeshift;
const root = j(file.source);
const printOptions = options.printOptions;
replaceComponentsWithSlots(j, {
root,
packageName: options.packageName,
componentName: 'Backdrop',
});
movePropIntoSlots(j, {
root,
packageName: options.packageName,
componentName: 'Backdrop',
propName: 'TransitionComponent',
slotName: 'transition',
});
return root.toSource(printOptions);
}