fix(upload): fix the upload status not being updated if the upload was successful #2133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (Bug 描述)
Steps to reproduce (复现步骤)
Expected behavior (预期行为)
Actual behavior (实际行为)
uploading
Related issues (相关 issue)
#1862
ant-design/ant-design#2423
Reason (原因)
uploading
的问题是因为 antd 的 BUG,导致onChange
方法的fileList
参数的值没有及时的更新,需要 antd 团队修复该问题React
升级到 18 版本有关(未验证)Solution (解决方案)
uploading
的问题onChange
的file
参数是正确的,所以可以根据file
实时的计算出fileList
的值fileList
需要通过一个useRef
保存,如果使用useState
同样会有问题Ref
中的值修复后的样子
其它
close T-650