react-photoswipe icon indicating copy to clipboard operation
react-photoswipe copied to clipboard

this.setState in the onClose

Open baktun14 opened this issue 7 years ago • 4 comments

Hi,

I was testing the PhotoSwipe component in my app and everything was working fine until I was zoomed and tried to logout(change route) and got a warning about setting the state on an unmounted component.

So I looked in the source and found that isOpen is actually handled on it's own in the state of the component and set to false when being closed. Here

I was wondering if there would be a way to override the isOpen with the actual props? It would be much better this way I think.

Thanks!

baktun14 avatar Oct 11 '16 18:10 baktun14

Got same warning too I use photoswipe in bootstrap modal , so when closing modal, i got warning and then can't use photoswipe normal on next modal opening.

plxel avatar Nov 01 '16 12:11 plxel

Did you found a way to solve it ?

jaskirk avatar May 22 '17 00:05 jaskirk

@jaskirk as for me - I can't reproduce this warning any more in my case

plxel avatar May 22 '17 05:05 plxel

Even i am facing the same issue! Parent Component is unmounting in my case!!

lineldcosta avatar Dec 11 '17 17:12 lineldcosta