Skip to content

Commit 00eade1

Browse files
ZauberNerdquantizor
authored andcommitted
Fix importName type confusion (string, bool, node) (#233)
Apparently `importName` can have many different types: #232 (comment) This commit ensures that the check whether the name is in the scope (bindings) does not break on plain strings. Closes: #232
1 parent 88bfd99 commit 00eade1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/visitors/transpileCssProp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default t => (path, state) => {
2929
const { bindings } = program.scope
3030

3131
// Insert import if it doesn't exist yet
32-
if (!importName || !bindings[importName.name]) {
32+
if (!importName || !bindings[importName.name] || !bindings[importName]) {
3333
addDefault(path, 'styled-components', {
3434
nameHint: 'styled',
3535
})

0 commit comments

Comments
 (0)