Skip to content

Use Lightbox component with an InfiniteScroll PhotoAlbum #178

Answered by igordanchenko
nimaen asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there!

Yes, it's possible to use the Lightbox component with the InfiniteScroll. You'd just need to keep a copy of all the fetched photos.

https://stackblitz.com/edit/react-photo-album-178?file=src%2Fcomponents%2FRowsExample.tsx

I'll think about simplifying this integration. I'll probably need to add an onClick callback to the InfiniteScroll component that also provides a current copy of the photos array:

<InfiniteScroll
  // ...
  onClick={({ photos, photo, index }) => ...}
>

Replies: 2 comments 2 replies

Comment options

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

Answer selected by nimaen
Comment options

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

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