Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

组件ImageUploader上传两张图片单数渲染4次,重复渲染 #6692

Open
YWSGM opened this issue Aug 1, 2024 · 5 comments
Open

组件ImageUploader上传两张图片单数渲染4次,重复渲染 #6692

YWSGM opened this issue Aug 1, 2024 · 5 comments
Labels

Comments

@YWSGM
Copy link

YWSGM commented Aug 1, 2024

Version of antd-mobile

5.37.1

Operating system and its version

Others

Browser and its version

chrome 127.0.6533.88

Sandbox to reproduce

No response

What happened?

组件ImageUploader上传两张图片单数渲染4次,重复渲染,期望渲染两次
Snipaste_2024-08-01_20-00-03

Relevant log output

No response

@YWSGM YWSGM added the bug label Aug 1, 2024
@Layouwen
Copy link
Contributor

Layouwen commented Aug 2, 2024

方便在比如 codesandbox 之类的在线平台, 提供复现 demo 吗

@YWSGM
Copy link
Author

YWSGM commented Aug 2, 2024

上传接口是集团内的不方便提供,我看下用官方文档的用例造一个出来demo

@YWSGM
Copy link
Author

YWSGM commented Aug 2, 2024

复现地址:https://codesandbox.io/s/spring-pond-6rnsrc?file=/app.tsx
复现步骤:上传第二张照片时会显示 4张
image

@caijf
Copy link
Contributor

caijf commented Aug 2, 2024

复现地址:https://codesandbox.io/s/spring-pond-6rnsrc?file=/app.tsx 复现步骤:上传第二张照片时会显示 4张 image

renderItem 只需要渲染当前参数的 file,你每个都map渲染导致上面结果(上传2张会渲染4张,上传3张会渲染9张)。

还有 key 重复了(跟本 issue 无关)

@YWSGM
Copy link
Author

YWSGM commented Aug 2, 2024

感谢,我去项目里试一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants