antd 组件库upload使用时onChange只会执行到 uploading状态 解决办法

antd 组件库使用时onChange只会执行到 uploading状态 解决办法
问题: 1.6.5版本 Upload控件onChange方法只会执行一次,且info.file.status一直为uploading,http请求正常,返回200。
降级为1.6.4之后正常使用,uploading之后info.file.status为done

这个方法在onChange时触发

  handleUploaderChange = (info) => {
    let fileList = [...info.fileList];
    fileList = fileList.slice(-2);
    // 2. Read from response and show file link
    fileList = fileList.map(file => {
      if (file.response) {
        // Component will show file.url as link
        file.url = file.response.url;
        console.log(222,fileList)
      }
      return file;
    });

    this.setState({ fileList });
    console.log(999,fileList)
  };

如何使用

    
               
点击上传

官方文档 https://ant.design/components/upload/#components-upload-demo-fileList

你可能感兴趣的:(js前端,antd,react,upload,uploading)