Mario-Duarte / react-image-zooom

Simple React component that will allow users to zoom in on your images, perfect for product images and galleries!
https://mario-duarte.github.io/react-image-zooom/
26 stars 6 forks source link

V1.2.0 - Better error handling #9

Closed Mario-Duarte closed 1 year ago

Mario-Duarte commented 1 year ago

This will add new properties that can be set to ImageZoom to better handle errors.

errorContent: Accepts string , JSX element or React component and will be rendered in place of the ImageZoom component when the image fails to load. This will default to default the following component:

Screenshot 2023-07-12 at 22 08 39

onError: Callback called when the image fails to load and the error object gets passed onto it.

All of this work is backwards compatible.