[TypeScript] CardMediaProps don't include certain props, i.e. "alt" of an "img" component #15010
Closed
2 tasks done
Labels
Milestone
While creating the TypeScript demo for the cards documentation I recognized that ts throws a compile error on the CardMedia component used in ImgMediaCard:
This is (in this case) due to the fact that the "img" component has the properties "alt" and "height" but the CardMediaProps don't account for additional props outside the standard props of an HTMLDivElement.
However, this does neither the CardMedia nor the ImgMediaCard prevent from working properly. It only prevents the TypeScript demo from being added to the documentation.
Expected Behavior 🤔
TypeScript should not throw an error if you use properties which get passed to the used component.
Current Behavior 😯
TypeScript throws an error if you use these properties because CardMediaProps don't account for additional props being passed down.
Steps to Reproduce 🕹
CardMedia
.Context 🔦
I tried to add demos for all card demos in ts. The problem with the typing of the properties makes the tslint check fail for the ImgMediaCard. But, as stated above, this is only a typing issue - the CardMedia component itself works.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: