react-photoswipe
react-photoswipe copied to clipboard
this.setState in the onClose
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!
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.
Did you found a way to solve it ?
@jaskirk as for me - I can't reproduce this warning any more in my case
Even i am facing the same issue! Parent Component is unmounting in my case!!