We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d3f0c8 commit 5705699Copy full SHA for 5705699
1 file changed
src/babel/core/get-foreign-bindings.ts
@@ -1,5 +1,6 @@
1
import type * as babel from '@babel/core';
2
import * as t from '@babel/types';
3
+import { isPathValid } from './unwrap';
4
5
function isForeignBinding(
6
source: babel.NodePath,
@@ -35,7 +36,10 @@ export function getForeignBindings(path: babel.NodePath): t.Identifier[] {
35
36
ReferencedIdentifier(p) {
37
// Check identifiers that aren't in a TS expression
38
if (!isInTypescript(p) && isForeignBinding(path, p, p.node.name)) {
- if (p.isIdentifier()) {
39
+ if (
40
+ isPathValid(p, t.isIdentifier) ||
41
+ isPathValid(p.parentPath, t.isJSXMemberExpression)
42
+ ) {
43
identifiers.add(p.node.name);
44
}
45
0 commit comments