There is my code to use image tag in typescript
<img
className="mediaImg"
src={imageUrl}
onload={() => console.log('dffffffffffffffffffffffff')}
style={{ ...theme.messages.mediaImg }}
/>
When I use onload
attribute there I get the error
Property 'onload' does not exist on type 'DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>'
Any help would be appreciated!!! Thank you
You have to call onLoad
instead onload
.
<img
className="mediaImg"
src={imageUrl}
onLoad={() => console.log('dffffffffffffffffffffffff')}
style={{ ...theme.messages.mediaImg }}
/>