Closed leopku closed 5 days ago
You should use the onClick
callback that is passed through as part of the imageProps
prop.
renderPhoto={({ imageProps }) => (
<img
// the onClick is already included in the imageProps
{...imageProps}
// override or add image props here
/>
)}
You can find the description and one specific example over here:
https://v2.react-photo-album.com/documentation#RenderPhoto https://v2.react-photo-album.com/examples/nextjs
https://v2.react-photo-album.com/documentation#RenderPhoto https://v2.react-photo-album.com/examples/nextjs
Nice. I need the document for v2 before I could upgrade this awesome library to v3.
Describe the bug
version:
react-photo-album
@2.4.1 andyet-another-react-lightbox
@3.20.0Codes were very simple and worked fine:
Today I need custom onError of img, so I add
renderPhoto
to custom rendering. The onError callback worked as expected but onClick seems not working while I click the image nothing happened even an onClick callback added on img tag.Expected behavior
When img clicked the lightbox should shown.
How to reproduce
Add
onClick
andrenderPhoto
both on PhotoAlbum.Click the image, lightbox not shown.
Screenshots / Logs
No response
Additional context
No response