Skip to content

Commit

Permalink
fix: 🐛 fixed duplicate react-native-svg duplicate import
Browse files Browse the repository at this point in the history
When updating the imports of react-native-svg there is no check on the importKind. This would cause a wrong update import and a crash in the cli.
  • Loading branch information
MohammadKurjieh committed Aug 4, 2023
1 parent 82928f0 commit eed9ba1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ const plugin = () => {

const importDeclarationVisitor = {
ImportDeclaration(path: NodePath<t.ImportDeclaration>, state: State) {
if (path.get('source').isStringLiteral({ value: 'react-native-svg' })) {
if (
path.get('source').isStringLiteral({ value: 'react-native-svg' }) &&
!path.get('importKind').hasNode()
) {
state.replacedComponents.forEach((component) => {
if (
path
Expand Down

0 comments on commit eed9ba1

Please # to comment.