diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 259ffc6312017..85c01429e4ce6 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -28375,6 +28375,7 @@ namespace ts {
*/
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement: JsxOpeningLikeElement, checkMode: CheckMode | undefined) {
const attributes = openingLikeElement.attributes;
+ const attributesType = getContextualType(attributes, ContextFlags.None);
const allAttributesTable = strictNullChecks ? createSymbolTable() : undefined;
let attributesTable = createSymbolTable();
let spread: Type = emptyJsxObjectType;
@@ -28403,6 +28404,12 @@ namespace ts {
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
explicitlySpecifyChildrenAttribute = true;
}
+ if (attributesType) {
+ const prop = getPropertyOfType(attributesType, member.escapedName);
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText as string);
+ }
+ }
}
else {
Debug.assert(attributeDecl.kind === SyntaxKind.JsxSpreadAttribute);
diff --git a/tests/cases/fourslash/jsdocDeprecated_suggestion18.ts b/tests/cases/fourslash/jsdocDeprecated_suggestion18.ts
new file mode 100644
index 0000000000000..abab252a190c0
--- /dev/null
+++ b/tests/cases/fourslash/jsdocDeprecated_suggestion18.ts
@@ -0,0 +1,25 @@
+///