react-photo-gallery icon indicating copy to clipboard operation
react-photo-gallery copied to clipboard

Additional props for photo

Open MiliusCZ opened this issue 3 years ago • 0 comments

I'd like to pass some extra properties for my photo into renderImage function. The renderImage accepts props of type

RenderImageProps<CustomPhotoProps extends object = {}>

but if I try to define my renderImage method like this:

const imageRenderer: React.FC<RenderImageProps<CustomImageProps> = ({ photo, index }) => { ... }

I get the error from Gallery component that renderImage function has incompatible props. What is the proper way to pass additional props to renderImage function?

MiliusCZ avatar Dec 08 '21 05:12 MiliusCZ