Open MiliusCZ opened 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?
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?