-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image: Add 'onError' property #3031
Comments
sorry @cetincakiroglu didn't see you assigned this to yourself already! |
It's okay, primarily I've been working on another issue thanks for your effort and fix 👍 |
@melloware did I miss something? |
Hmmm Image extends HtmlSpanElement. export interface ImageProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, 'ref' | 'pt'> { And HtmlSpanElement has this... /**
* Fires when an error occurs during object loading.
* @param ev The event.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLElement/error_event)
*/
onerror: OnErrorEventHandler; |
Describe the feature you would like to see added
I would love to be able to pass the 'onError' property through to the underlying img element of the Image component.
Is your feature request related to a problem?
No response
Describe the solution you'd like
I would like to react properly and show a fallback image if the Image component is not able to load the given image source. Right now it is only possible to show an alternative string instead, which doesn't look nice in every use case.
Describe alternatives you have considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: