Skip to content

Commit 5705699

Browse files
committed
Fix dependency collection
1 parent 8d3f0c8 commit 5705699

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/babel/core/get-foreign-bindings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type * as babel from '@babel/core';
22
import * as t from '@babel/types';
3+
import { isPathValid } from './unwrap';
34

45
function isForeignBinding(
56
source: babel.NodePath,
@@ -35,7 +36,10 @@ export function getForeignBindings(path: babel.NodePath): t.Identifier[] {
3536
ReferencedIdentifier(p) {
3637
// Check identifiers that aren't in a TS expression
3738
if (!isInTypescript(p) && isForeignBinding(path, p, p.node.name)) {
38-
if (p.isIdentifier()) {
39+
if (
40+
isPathValid(p, t.isIdentifier) ||
41+
isPathValid(p.parentPath, t.isJSXMemberExpression)
42+
) {
3943
identifiers.add(p.node.name);
4044
}
4145
}

0 commit comments

Comments
 (0)