From 7dc050f3658be714ff29987f565c3b50670a7e85 Mon Sep 17 00:00:00 2001 From: Mark David Avery Date: Wed, 19 Sep 2018 10:44:21 -0700 Subject: [PATCH] fix: using local rather then imported so access the actual variable in something like `import { foo as bar } from 'fee';` `foo` is the imported part, while `bar` is the local. we just want the local this enables one to import other `styleNamespaces` and use them in the component. --- lib/babel-add-style-namespace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/babel-add-style-namespace.js b/lib/babel-add-style-namespace.js index ab23088..e30f07b 100644 --- a/lib/babel-add-style-namespace.js +++ b/lib/babel-add-style-namespace.js @@ -49,7 +49,7 @@ module.exports = function ({ types: t }) { }, ImportSpecifier(path) { - if (!this.found && path.get('imported').isIdentifier({ name: STYLE_NAMESPACE_PROPERTY.NAME })) { + if (!this.found && path.get('local').isIdentifier({ name: STYLE_NAMESPACE_PROPERTY.NAME })) { this.found = true; path.stop(); }