AdamRisberg / react-image-magnifiers

A collection of responsive, image magnifying React components for mouse and touch.
MIT License
347 stars 60 forks source link

onError function #9

Closed ozanoz34 closed 5 years ago

ozanoz34 commented 5 years ago

Is there a way to use onError function for the tag? Because right now as I see, when the original src link doesn't work, there is no fallBackUrl option.

AdamRisberg commented 5 years ago

I added an image fallback feature (version 1.2.1). The imageSrc and largeImageSrc props on all components now accept either a single image path or an array of paths. If an array is provided, it will try each path in order until either one loads, or the end of the array is reached.

ozanoz34 commented 5 years ago

Thank you for the quick answer and quick fix! Everything works fine now :)