Using photoswipe with React.js #2139
Unanswered
therahulchaurasia
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello devs,
I found your package while inspecting the code on dribbble, because I thought the image zoom was cool :)
So, I decided to use it in one of my projects.
The docs were pretty easy to find and go through. That's when I found the stackblitz code playground for React.js. I followed the steps and used it in my project.
useEffect(() => {
let lightbox = new PhotoSwipeLightbox({
gallery: '#' + props.galleryID,
children: 'a',
pswpModule: () => import('photoswipe'),
});
lightbox.init();
}, []);
Type 'null' is not assignable to type 'PhotoSwipeLightbox'.ts(2322).
So, I commented the lightbox = null and everything still works fine. Is it the right thing to do?
Beta Was this translation helpful? Give feedback.
All reactions