react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

fallback image support for Image component

Open jees47 opened this issue 1 year ago • 2 comments

I want to load a default image or fallback image when the image component cant load the image

I have tried giving onError prop so that i know the image have not loaded. but that doesnt work. And i couldnt find any props that gvie the functionality

here is my example,

    const handleError = () => {
      setImageUrl(`/img/${type}.png`);
    };

<Image style={styles.imageCardCustom} src={imageUrl} onError={handleError}/>

jees47 avatar Sep 08 '23 04:09 jees47

Please assign this issue to me

apurvapatwardhan avatar Sep 12 '23 03:09 apurvapatwardhan

Will need a way to replicate this

diegomura avatar Feb 03 '24 18:02 diegomura