Skip to content

Commit 7c3f927

Browse files
committed
Fix passing t through
1 parent 3a56c9e commit 7c3f927

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/visitors/transpileCssProp.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// @see https://github.com/satya164/babel-plugin-css-prop
33
import { useCssProp } from '../utils/options'
44

5-
const getTag = node => {
5+
const getTag = (node, t) => {
66
if (typeof node.name === 'string') return node.name
77
if (t.isJSXMemberExpression(node)) {
8-
return `${getTag(node.object)}.${node.property.name}`
8+
return `${getTag(node.object, t)}.${node.property.name}`
99
}
10-
throw path.buildCodeFrameError('Failed to get the name');
10+
throw path.buildCodeFrameError('Failed to get the name')
1111
}
1212

1313
export default t => (path, state) => {
@@ -29,7 +29,7 @@ export default t => (path, state) => {
2929
}
3030

3131
const elem = path.parentPath
32-
const name = getTag(elem.node.name)
32+
const name = getTag(elem.node.name, t)
3333
const id = path.scope.generateUidIdentifier(
3434
'Styled' + name.replace(/^([a-z])/, (match, p1) => p1.toUpperCase())
3535
)

0 commit comments

Comments
 (0)