Does this support a fallback image if the img is not loaded?
See original GitHub issueI think it should roll back to placeholderSrc if src is not found…
I can check at my end if there is no property, but if its set to black; the library before would just try to load a broken image; instead it should return something that makes the placeholderSrc render.
I used this
src={img_url ? img_url : placeholderImg}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Inputting a default image in case the src attribute of an html ...
when an error occurs, all srcset's are set to the fallback version. a broken link image is not showing up. it does not...
Read more >Handling <img /> fallback. - Medium
Our first problem is when an image URL is stored in DB and that URL can be broken due to any reason. we...
Read more >HTML only image fallback - DEV Community
Below an image is embedded in an 'object' tag. If that image is not loaded correctly (e.g. inexistent image) the 'img' inside it...
Read more >Native Lazy Image Loading With JavaScript Fallback
Until recently, lazy image loading required JavaScript - typically by reconfiguring <img> s with a placeholder and then detecting when each image comes...
Read more >HTML fallback images on error - Daily Dev Tips
So what can we do when this happens? We can use the onerror attribute on the image to set a fallback. It works...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not what I’m seeing.
<img>
element is there even if loading the image fails.i think a
fallback
props oronError
callback is needed,take the README examle:if the Comments Comp is load failed for some reason, i can show the ErrorHint Comp
another realworld example is the
net::ERR_CONNECTION_REFUSED
error when load image fails can not fallback to placeholder, and i have to do very ugly staff to do that