diff --git a/lib/util/propTypes.js b/lib/util/propTypes.js index 0eac6189a3..60fbff889f 100644 --- a/lib/util/propTypes.js +++ b/lib/util/propTypes.js @@ -644,9 +644,14 @@ module.exports = function propTypesInstructions(context, components, utils) { // So we should construct an optional children prop this.shouldSpecifyOptionalChildrenProps = true; - this.shouldSpecifyClassNameProp = true; - const rightMostName = getRightMostTypeName(node.typeName); + if ( + leftMostName === 'React' + && ['HTMLAttributes', 'HTMLElement', 'HTMLProps'].some((type) => rightMostName.includes(type)) + ) { + this.shouldSpecifyClassNameProp = true; + } + const importedName = localToImportedMap[rightMostName]; const idx = genericTypeParamIndexWherePropsArePresent[ leftMostName !== rightMostName ? rightMostName : importedName