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: Description children missing key #45757

Merged
merged 1 commit into from Nov 9, 2023
Merged

fix: Description children missing key #45757

merged 1 commit into from Nov 9, 2023

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Nov 9, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Descriptions use children structure missing the Descriptions.Item key prop.
🇨🇳 Chinese 修复 Descriptions 使用 children 结构语法糖时,会丢失 Descriptions.Item 的 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 22c9eaa

This pull request fixes a react key prop error in the Descriptions component when using jsx mode. It adds a test case for the useItems hook and modifies the transChildren2Items function in components/descriptions/hooks/useItems.ts to preserve the key prop of the Descriptions.Item component.

🔍 Walkthrough

🤖 Generated by Copilot at 22c9eaa

  • Preserve the key prop of the Descriptions.Item component to avoid react key prop error and identify the component (link)
  • Add a test case for the useItems hook to check that it does not throw a react key prop error when using jsx mode to render the Descriptions.Item component (link)

Copy link

stackblitz bot commented Nov 9, 2023

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

Copy link
Contributor

github-actions bot commented Nov 9, 2023

Preview Is ready

Copy link
Contributor

github-actions bot commented Nov 9, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 400.81 KB (+7 B 🔺)
./dist/antd-with-locales.min.js 460.15 KB (+4 B 🔺)

Copy link

codesandbox-ci bot commented Nov 9, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 22c9eaa:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

argos-ci bot commented Nov 9, 2023

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Nov 9, 2023, 8:03 AM

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e5a213d) 100.00% compared to head (22c9eaa) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #45757   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          700       700           
  Lines        11828     11828           
  Branches      3153      3153           
=========================================
  Hits         11828     11828           
Files Coverage Δ
components/descriptions/hooks/useItems.ts 100.00% <100.00%> (ø)

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

@zombieJ zombieJ merged commit 5261f1e into master Nov 9, 2023
101 checks passed
@zombieJ zombieJ deleted the desc-key branch November 9, 2023 08:37
@zombieJ zombieJ mentioned this pull request Nov 9, 2023
16 tasks
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.

None yet

3 participants