neptunian / react-photo-gallery

React Photo Gallery

Home Page:http://neptunian.github.io/react-photo-gallery/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional props for photo

MiliusCZ opened this issue · 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?