Skip to content

fix: Select unknown props warning on dom element#56341

Merged
thinkasany merged 2 commits intomasterfrom
afc163-patch-1
Dec 25, 2025
Merged

fix: Select unknown props warning on dom element#56341
thinkasany merged 2 commits intomasterfrom
afc163-patch-1

Conversation

@afc163
Copy link
Member

@afc163 afc163 commented Dec 24, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

close #55877

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

react-component/select#1189

📝 Change Log

Language Changelog
🇺🇸 English Fix Select options props leaking to DOM elements and causing React unknown-prop warnings.
🇨🇳 Chinese 修复 Select options 内属性会传递到 dom 元素导致 React 出现无关属性的警告。

Signed-off-by: afc163 <afc163@gmail.com>
@bolt-new-by-stackblitz
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

👁 Visual Regression Report for PR #56341 Failed ❌

🎯 Target branch: master (2ffd8a7)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 3 changed

Expected (Branch master) Actual (Current PR) Diff
segmented-controlled-two.dark.png segmented-controlled-two.dark.png segmented-controlled-two.dark.png segmented-controlled-two.dark.png
table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png
table-sticky.default.png table-sticky.default.png table-sticky.default.png table-sticky.default.png

Important

There are 3 diffs found in this PR: 🔄 3 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

Preview is ready

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @afc163, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a common React warning related to unknown props being passed to DOM elements. Specifically, it fixes an issue where properties from the Select component's options were inadvertently rendered on the DOM. The resolution involves updating several @rc-component dependencies, including @rc-component/select, to newer versions that contain the necessary corrections to prevent this prop leakage.

Highlights

  • Dependency Updates: Updated @rc-component/cascader, @rc-component/select, and @rc-component/tree-select to their latest patch or minor versions to incorporate bug fixes.
  • Bug Fix: Resolved an issue where Select component options props were incorrectly leaking to DOM elements, causing React to emit 'unknown prop' warnings.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

📝 Walkthrough

Summary by CodeRabbit

发布说明

  • Chores
    • 更新了若干 UI 组件库的依赖版本以获取最新修复与改进(包括级联、选择与树选择组件的次版本升级)。
    • 仅修改了对外依赖声明,未更改运行逻辑或错误处理。

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

更新 package.json 中三个 @rc-component 依赖的版本声明:@rc-component/cascader@rc-component/select@rc-component/tree-select,仅修改依赖版本号,无其他逻辑或控制流变更。

Changes

Cohort / File(s) 更改说明
依赖版本声明
package.json
升级依赖版本:@rc-component/cascader~1.9.0 -> ~1.10.0@rc-component/select~1.3.6 -> ~1.4.0@rc-component/tree-select~1.4.0 -> ~1.5.0。仅 package.json 中的版本声明变更。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分钟

Poem

🐰 依赖轻跃换新鞋,
版本悄然上台阶,
级联、选择与树选,
清风送来小小喜,
兔儿眨眼庆更新。

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确反映了主要变更内容,即修复 Select 组件的未知属性警告问题。
Description check ✅ Passed 描述清晰地说明了这是一个 Bug 修复,并提供了相关的 Issue 链接和背景信息,与变更内容相关。
Linked Issues check ✅ Passed PR 通过更新依赖版本(@rc-component/select 从 ~1.3.6 升级到 ~1.4.0)解决了 Issue #55877 中报告的 Select 组件选项属性泄露到 DOM 导致的 React 警告问题。
Out of Scope Changes check ✅ Passed PR 中的所有变更(更新三个 RC 组件依赖版本)都与修复 Select 未知属性警告的目标相关,没有发现范围外的改动。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch afc163-patch-1

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83efa43 and cf794df.

📒 Files selected for processing (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: test lib/es module (es, 1/2)
  • GitHub Check: test-react-legacy (18, 2/2)
  • GitHub Check: test-react-latest (dom, 1/2)
  • GitHub Check: test-react-legacy (18, 1/2)
  • GitHub Check: test-react-latest (dom, 2/2)
  • GitHub Check: test-node
  • GitHub Check: test lib/es module (es, 2/2)
  • GitHub Check: build preview
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: build
  • GitHub Check: visual-diff snapshot (2/2)
  • GitHub Check: visual-diff snapshot (1/2)
  • GitHub Check: size
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: ant-design-next

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link

socket-security bot commented Dec 24, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​rc-component/​cascader@​1.9.0 ⏵ 1.10.08410010096 -1100
Updated@​rc-component/​tree-select@​1.4.0 ⏵ 1.5.085 +110010097 +1100
Added@​rc-component/​select@​1.4.08610010099100

View full report

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the versions of @rc-component/cascader, @rc-component/select, and @rc-component/tree-select to fix a bug where unknown props on Select options were being passed to DOM elements, causing React warnings. Updating these dependencies is the correct approach to resolve the issue by bringing in fixes from the underlying component libraries. The changes are appropriate and I see no issues with this pull request.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 24, 2025

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf794df
Status: ✅  Deploy successful!
Preview URL: https://18c93c90.ant-design-next.pages.dev
Branch Preview URL: https://afc163-patch-1.ant-design-next.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 24, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf794df
Status: ✅  Deploy successful!
Preview URL: https://a4356b88.ant-design.pages.dev
Branch Preview URL: https://afc163-patch-1.ant-design.pages.dev

View logs

@codecov
Copy link

codecov bot commented Dec 24, 2025

Bundle Report

Changes will decrease total bundle size by 8.12MB (-67.79%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.86MB -8.12MB (-67.79%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js (New) 2.12MB 2.12MB 100.0% 🚀
antd.min.js (New) 1.74MB 1.74MB 100.0% 🚀
antd-with-locales.js (Deleted) -6.3MB 0 bytes -100.0% 🗑️
antd.js (Deleted) -5.68MB 0 bytes -100.0% 🗑️

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ea4d320) to head (cf794df).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #56341   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          804       804           
  Lines        14838     14838           
  Branches      3919      3919           
=========================================
  Hits         14838     14838           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

size-limit report 📦

Path Size
dist/antd.min.js 521.96 KB (-15 B 🔽)
dist/antd-with-locales.min.js 615.2 KB (-12 B 🔽)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 24, 2025

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 24, 2025
@afc163 afc163 requested a review from zombieJ December 24, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug 6.0] Select 组件的 options 选项存在 label/value 等它支持的属性外的其他属性时 React 报警告错误

4 participants