neptunian / react-photo-gallery

React Photo Gallery
http://neptunian.github.io/react-photo-gallery/
Other
1.97k stars 310 forks source link

Additional props for photo #212

Open MiliusCZ opened 2 years ago

MiliusCZ commented 2 years ago

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?