Skip to content

Commit

Permalink
update lightbox eg
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Jun 22, 2019
1 parent f4a2310 commit 25dc782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/src/ExampleWithLightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function ExampleWithLightbox({ photos }) {
const [currentImage, setCurrentImage] = useState(0);
const [viewerIsOpen, setViewerIsOpen] = useState(false);

const openLightbox = useCallback((event, obj) => {
setCurrentImage(obj.index);
const openLightbox = useCallback((event, { photo, index }) => {
setCurrentImage(index);
setViewerIsOpen(true);
}, []);

Expand Down

0 comments on commit 25dc782

Please sign in to comment.