Skip to content

How to use programmatically when gallery can't be modified? #819

Answered by irudoy
johtso asked this question in Q&A
Discussion options

You must be logged in to vote

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 the PhotoSwipe class instead of PhotoSwipeLightbox 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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johtso
Comment options

Answer selected by johtso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants