Can someone help with the TypeScript error:
Property 'srcset' does not exist on type 'DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>'.
I can't figure out what is going wrong. I also tried this solution, but no result:
declare global {
namespace JSX {
interface IntrinsicElements {
srcset: React.DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>
}
}
}
Can someone help with the TypeScript error:
Property 'srcset' does not exist on type 'DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>'.
I can't figure out what is going wrong. I also tried this solution, but no result:
declare global {
namespace JSX {
interface IntrinsicElements {
srcset: React.DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>
}
}
}
Share
Improve this question
asked Jul 17, 2019 at 16:45
Max TravisMax Travis
1,3284 gold badges22 silver badges43 bronze badges
1
- stackoverflow./a/34695900/367865 – Ouroborus Commented Jul 17, 2019 at 17:32
1 Answer
Reset to default 7The solution is to use srcSet
instead of srcset
-> Why is React.js removing the srcset tag on <img />?