-
I'm wondering how you would use this library to open a specific image in the lightbox without having to use I have an existing gallery using the masonic library for virtualised infinite scrolling. What I need is a callback that I can bind to the onclick of my images, and some way to give photoswipe an array of the images in my gallery. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This wrapper aims to serialize React elements tree into the plain array and provide it to the PhotoSwipe. Seems like it's better to initialize PhotoSwipe manually in the Anyway, if you think this library can have some API that could reduce configuration complexity – feel free to create an issue with a proposal and a clear explanation of which problem it solves. |
Beta Was this translation helpful? Give feedback.
This wrapper aims to serialize React elements tree into the plain array and provide it to the PhotoSwipe. Seems like it's better to initialize PhotoSwipe manually in the
useEffect
hook for your particular case. This example covers it. But I would suggest using thePhotoSwipe
class instead ofPhotoSwipeLightbox
for a more flexible configuration.Anyway, if you think this library can have some API that could reduce configuration complexity – feel free to create an issue with a proposal and a clear explanation of which problem it solves.