@@ -25412,26 +25412,29 @@ namespace ts {
25412
25412
}
25413
25413
25414
25414
checkJsxPreconditions(node);
25415
- // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import.
25416
- // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error.
25417
- const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
25418
- const jsxFactoryNamespace = getJsxNamespace(node);
25419
- const jsxFactoryLocation = isNodeOpeningLikeElement ? (<JsxOpeningLikeElement>node).tagName : node;
25420
-
25421
- // allow null as jsxFragmentFactory
25422
- let jsxFactorySym: Symbol | undefined;
25423
- if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
25424
- jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, SymbolFlags.Value, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true);
25425
- }
25426
-
25427
- if (jsxFactorySym) {
25428
- // Mark local symbol as referenced here because it might not have been marked
25429
- // if jsx emit was not jsxFactory as there wont be error being emitted
25430
- jsxFactorySym.isReferenced = SymbolFlags.All;
25431
-
25432
- // If react/jsxFactory symbol is alias, mark it as refereced
25433
- if (jsxFactorySym.flags & SymbolFlags.Alias && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
25434
- markAliasSymbolAsReferenced(jsxFactorySym);
25415
+
25416
+ if (!getJsxNamespaceContainerForImplicitImport(node)) {
25417
+ // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import.
25418
+ // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error.
25419
+ const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
25420
+ const jsxFactoryNamespace = getJsxNamespace(node);
25421
+ const jsxFactoryLocation = isNodeOpeningLikeElement ? (<JsxOpeningLikeElement>node).tagName : node;
25422
+
25423
+ // allow null as jsxFragmentFactory
25424
+ let jsxFactorySym: Symbol | undefined;
25425
+ if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
25426
+ jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, SymbolFlags.Value, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true);
25427
+ }
25428
+
25429
+ if (jsxFactorySym) {
25430
+ // Mark local symbol as referenced here because it might not have been marked
25431
+ // if jsx emit was not jsxFactory as there wont be error being emitted
25432
+ jsxFactorySym.isReferenced = SymbolFlags.All;
25433
+
25434
+ // If react/jsxFactory symbol is alias, mark it as refereced
25435
+ if (jsxFactorySym.flags & SymbolFlags.Alias && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {
25436
+ markAliasSymbolAsReferenced(jsxFactorySym);
25437
+ }
25435
25438
}
25436
25439
}
25437
25440
0 commit comments