refactor(react): a JSX tag's module reads the import mapping's resolved path first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-10-07 09:15:58 -05:00
parent 58a873809f
commit dce9ba4ae5
+1 -1
View File
@@ -1551,7 +1551,7 @@ function importedJsxChild(ctx: ResolutionContext, name: string, file: string, la
if (!ctx.resolveImport || !ctx.getNodeById) return undefined;
const mapping = ctx.getImportMappings(file, language).find((m) => m.localName === name);
if (!mapping || mapping.isNamespace) return undefined;
const module = resolveImportPath(mapping.source, file, language, ctx);
const module = mapping.resolvedPath ?? resolveImportPath(mapping.source, file, language, ctx);
if (!module) return undefined;
const resolved = ctx.resolveImport({
fromNodeId: '', referenceName: name, referenceKind: 'references', line: 0, column: 0, filePath: file, language,