ascoders / react-native-image-viewer

🚀 tiny & fast lib for react native image viewer pan and zoom
MIT License
2.44k stars 576 forks source link

ERROR Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in ImageViewer #458

Open gerfisher opened 3 years ago

gerfisher commented 3 years ago

ERROR Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in ImageViewer

crventra941 commented 3 years ago

I have the same issue!!

bekatru commented 2 years ago

I'll add some details here. I am rendering <ImageViewer /> inside a modal window.

 <Modal
          visible={imageViewerModalVisible}
          animationType={"fade"}
          transparent={true}
        >
          <ImageViewer
            index={imageViewerIndex}
            enableImageZoom={true}
            backgroundColor={"rgba(0, 0, 0, .8)"}
            enableSwipeDown={true}
            onSwipeDown={() => setImageViewerModalVisible(null)}
            imageUrls={eventGallery.map((i) => ({ url: i }))}
          />
        </Modal>