File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 22// @see https://github.com/satya164/babel-plugin-css-prop
33import { 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
1313export 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 )
You can’t perform that action at this time.
0 commit comments