Skip to content

Commit 35fbbe2

Browse files
authored
Update getComponentProps.ts
1 parent 94d1391 commit 35fbbe2

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

packages/typescript-plugin/lib/requests/getComponentProps.ts

+12-14
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,18 @@ export function getComponentProps(
8686
}
8787

8888
let isAttribute: boolean | undefined;
89-
for (const root of checker.getRootSymbols(prop)) {
90-
for (const { parent } of root.declarations ?? []) {
91-
if (!ts.isInterfaceDeclaration(parent)) {
92-
continue;
93-
}
94-
const { text } = parent.name;
95-
if (
96-
text.endsWith('HTMLAttributes')
97-
|| text === 'AriaAttributes'
98-
|| text === 'SVGAttributes'
99-
) {
100-
isAttribute = true;
101-
break;
102-
}
89+
for (const { parent } of checker.getRootSymbols(prop).flatMap((root) => root.declarations ?? [])) {
90+
if (!ts.isInterfaceDeclaration(parent)) {
91+
continue;
92+
}
93+
const { text } = parent.name;
94+
if (
95+
text.endsWith('HTMLAttributes')
96+
|| text === 'AriaAttributes'
97+
|| text === 'SVGAttributes'
98+
) {
99+
isAttribute = true;
100+
break;
103101
}
104102
}
105103

0 commit comments

Comments
 (0)