From 25dc7828363888b1e46b142c3c1a6144670f7c17 Mon Sep 17 00:00:00 2001 From: Sandra Date: Sat, 22 Jun 2019 13:07:23 -0400 Subject: [PATCH] update lightbox eg --- examples/src/ExampleWithLightbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/src/ExampleWithLightbox.js b/examples/src/ExampleWithLightbox.js index b5fd555..4420cf3 100644 --- a/examples/src/ExampleWithLightbox.js +++ b/examples/src/ExampleWithLightbox.js @@ -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); }, []);