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

passed RenderImage may not be a react class component, but typescript types indicate otherwise

Open duesenfranz opened this issue 4 years ago • 0 comments

When passing a class component as RenderImage, the error Uncaught TypeError: renderComponent is not a function gets thrown here: https://github.com/neptunian/react-photo-gallery/blob/0bb8e4c4a027c021f8a5a06de71e89026596fd95/src/Gallery.js#L99-L109

An easy fix seems to be to call renderComponents using jsx syntax, like <renderComponent left=left [...] />. If this is for some reason not possible, the line https://github.com/neptunian/react-photo-gallery/blob/0bb8e4c4a027c021f8a5a06de71e89026596fd95/index.d.ts#L115

should be changed to renderImage?: React.StatelessFunctionalComponent<RenderImageProps<CustomPhotoProps>>

duesenfranz avatar Feb 09 '21 10:02 duesenfranz