ascoders / react-native-image-viewer

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

Cannot update during an existing state transition warning #431

Open Aryk opened 3 years ago

Aryk commented 3 years ago

I believe it's coming from here:

    // 保存 imageSize
    const saveImageSize = () => {
      // 如果已经 success 了,就不做处理
      if (this!.state!.imageSizes![index] && this!.state!.imageSizes![index].status !== 'loading') {
        return;
      }

      const imageSizes = this!.state!.imageSizes!.slice();
      imageSizes[index] = imageStatus;
      this.setState({ imageSizes });
    };

B93CCCEE-1E4B-44EC-8E56-4E9B46524C10