Skip to content

Commit

Permalink
fix: typescript error
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiah-clothier committed Nov 18, 2024
1 parent feac117 commit 595dd7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/migrate/transforms/rename-jsx-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default function transform({ file, changes }: TransformOptions) {
});

namedImport.setName(changeToApply.newImportName);
namedImport.getNameNode().rename(changeToApply.newImportName);
const namedNode = namedImport.getNameNode();
if ('rename' in namedNode) {
namedNode.rename(changeToApply.newImportName);
}

if (changeToApply.removeAlias) {
namedImport.removeAliasWithRename();
} else if (changeToApply.alias) {
Expand Down

0 comments on commit 595dd7c

Please sign in to comment.