Skip to content

Commit a5417b9

Browse files
committed
fix: Detect better parent
1 parent ebf666b commit a5417b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function ({ types: t }) {
55
visitor: {
66
ArrowFunctionExpression (path, state) {
77
const options = checkValidOptions(state)
8-
if (!path.parent) return
8+
if (!path.parent.id || !path.parent.id.name) return
99
const componentName = path.parent.id.name
1010

1111
const functionBody = path.get('body').get('body')

0 commit comments

Comments
 (0)