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

fix: Descriptions key prop issue #44278

Merged
merged 2 commits into from Aug 17, 2023
Merged

Conversation

RedJue
Copy link
Member

@RedJue RedJue commented Aug 17, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

close #44250

💡 Background and solution

image

📝 Changelog

Language Changelog
🇺🇸 English Fix a bug in the Descriptions where the throws react key error
🇨🇳 Chinese 修复描述列表抛出 React key 的错误

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 2e65729

Fix a react key prop error in Descriptions component when using jsx mode. Clone child props instead of mutating them in useRow hook. Add a test case for the bug fix.

🔍 Walkthrough

🤖 Generated by Copilot at 2e65729

  • Prevent react key prop error in Descriptions component when using jsx mode (link)
  • Modify the transChildren2Items function in components/descriptions/hooks/useRow.ts to clone the props of each child node instead of mutating them (link)

@stackblitz
Copy link

stackblitz bot commented Aug 17, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 17, 2023

@RedJue RedJue force-pushed the fix-descriptions-key-prop-issue branch from 2e65729 to 9e3b697 Compare August 17, 2023 12:32
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 387.67 KB (+5 B 🔺)
./dist/antd-with-locales.min.js 446.66 KB (+4 B 🔺)

@argos-ci
Copy link

argos-ci bot commented Aug 17, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Aug 17, 2023, 12:46 PM

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7179dc8) 100.00% compared to head (9e3b697) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #44278   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          659       659           
  Lines        11199     11199           
  Branches      3033      3033           
=========================================
  Hits         11199     11199           
Files Changed Coverage Δ
components/descriptions/hooks/useRow.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MadCcc MadCcc merged commit 73cfd37 into master Aug 17, 2023
91 checks passed
@MadCcc MadCcc deleted the fix-descriptions-key-prop-issue branch August 17, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Descriptions 组件 children 是 DescrptionsItem 数组(并设置好key) 后, 报警告
3 participants