Skip to content
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

Customized onError property function #247

Closed
wants to merge 1 commit into from

Conversation

XiChenn
Copy link

@XiChenn XiChenn commented Oct 2, 2019

Sometimes when the component could not get the image data from a URL, instead of displaying nothing, we want some customized actions. So, if onError function is passed down to Img component, it will get executed. Otherwise, it remains the current behavior.

Sometimes when the component could not get the image data from a URL, instead of displaying nothing, we want some customized actions. So, if onError function is passed down to Img component, it will execute. Otherwise, it remains the current behavior.
@mbrevda
Copy link
Owner

mbrevda commented Oct 3, 2019

Thanks for taking the time to submit a PR! This has been discussed many times, see here for background: #192

@mbrevda mbrevda closed this Oct 3, 2019
@mbrevda
Copy link
Owner

mbrevda commented May 20, 2020

It is now possible to inject a custom image loader with any desired behavior. You can pass it as a prop to the useImage hook or to the component, see more here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants