socialtables / react-image-fallback

stop displaying broken images, have another image to fallback on.
111 stars 18 forks source link

fallbackImage as array? #33

Closed mbrevda closed 8 years ago

mbrevda commented 8 years ago

Would it be possible to convert fallbackImage to an array, so that we can have multiple fallbacks? In case the first is missing, try the second, etc...

mattaningram commented 8 years ago

This was originally a feature but was then removed for some reason (probably harder to do than it seems). I do hope they bring it back, we had a great equivalent in Angular.

conorhastings commented 8 years ago

@mbrevda @mattaningram Thanks for the feedback! The previous implementation never really worked and was reverted pretty quickly. We never really used it internally so didn't have a need to focus on it but I had some time tonight and was able to implement. Passing fallbackImage as an array should be available in 3.2.0

mattaningram commented 8 years ago

That was awesomely fast @conorhastings thanks for all your hard work!

mbrevda commented 8 years ago

Thanks! One more note: perhaps it would make sense to just pass the array as srcImage, with no need for a separate property for the fallback...

On Fri, Sep 2, 2016 at 5:29 AM Mattan Ingram notifications@github.com wrote:

That was awesomely fast @conorhastings https://github.com/conorhastings thanks for all your hard work!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/socialtables/react-image-fallback/issues/33#issuecomment-244267536, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4jDr6rjvmeRb4_1dnpG60J9gpV_ZYks5ql4n2gaJpZM4JxXxB .

conorhastings commented 8 years ago

@mbrevda I think that potentially I would like to support arrays for both, but don't neccesarily think we'll deprecate fallbackImage as some may prefer that api.

mbrevda commented 7 years ago

I've gone ahead and released my own lib which supports multiple fallbacks: https://www.npmjs.com/package/react-image

Thanks!