This commit is contained in:
Manav Rathi
2025-01-06 15:13:50 +05:30
parent 43c464120f
commit 5abbcd4228

View File

@@ -140,7 +140,7 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
PublicCollectionGalleryContext,
);
const pswpElement = useRef<HTMLDivElement>();
const pswpElement = useRef<HTMLDivElement | undefined>(undefined);
const [photoSwipe, setPhotoSwipe] =
useState<Photoswipe<Photoswipe.Options>>();
const [showInfo, setShowInfo] = useState(false);
@@ -184,7 +184,7 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
);
useEffect(() => {
if (!pswpElement) return;
if (!pswpElement.current) return;
if (isOpen) {
openPhotoSwipe();
}