Skip to content

fix: add tag useColor hooks missing memo deps#55555

Merged
meet-student merged 1 commit intonextfrom
memo-deps-tag
Nov 1, 2025
Merged

fix: add tag useColor hooks missing memo deps#55555
meet-student merged 1 commit intonextfrom
memo-deps-tag

Conversation

@thinkasany
Copy link
Copy Markdown
Member

🤔 This is a ...

  • ❓ Other (about what?)

🔗 Related Issues

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

💡 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.

📝 Change Log

Language Changelog
🇺🇸 English -
🇨🇳 Chinese -

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 1, 2025

👁 Visual Regression Report for PR #55555 Passed ✅

🎯 Target branch: next (2399d5d)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 1, 2025

Preview is ready

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @thinkasany, 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 subtle but important issue in the useColor React hook by ensuring that all relevant dependencies are correctly listed in its useMemo dependency array. This change prevents potential bugs related to stale values and guarantees that the hook's output consistently reflects the current state, thereby improving the reliability and predictability of tag color rendering.

Highlights

  • Dependency Array Update: The useMemo hook within components/tag/hooks/useColor.ts has been updated to include contextVariant in its dependency array. This ensures proper memoization and prevents potential stale closures or unnecessary re-renders when contextVariant changes.
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
Copy Markdown
Contributor

coderabbitai Bot commented Nov 1, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch memo-deps-tag

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.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: a319496
Status:🚫  Build failed.

View logs

Copy link
Copy Markdown
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 correctly addresses a bug in the useColor hook by adding the missing contextVariant dependency to the useMemo dependency array. This is an important fix that ensures the Tag component will correctly update its variant when the value is provided through ConfigProvider context, preventing UI inconsistencies. The change is accurate and effectively resolves the issue. Well done.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 1, 2025

size-limit report 📦

Path Size
dist/antd.min.js 495.38 KB (+1 B 🔺)
dist/antd-with-locales.min.js 587.53 KB (+2 B 🔺)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Nov 1, 2025

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2025

Bundle Report

Changes will increase total bundle size by 32 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 11.8MB 32 bytes (0.0%) ⬆️

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.js 16 bytes 6.2MB 0.0%
antd.js 16 bytes 5.59MB 0.0%

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: a319496
Status: ✅  Deploy successful!
Preview URL: https://c9a1806b.ant-design-next.pages.dev
Branch Preview URL: https://memo-deps-tag.ant-design-next.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #55555   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          796       796           
  Lines        14690     14690           
  Branches      3899      3899           
=========================================
  Hits         14690     14690           

☔ 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.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Nov 1, 2025
@meet-student meet-student merged commit 0163503 into next Nov 1, 2025
47 of 49 checks passed
@meet-student meet-student deleted the memo-deps-tag branch November 1, 2025 06:41
@zombieJ zombieJ mentioned this pull request Nov 4, 2025
17 tasks
afc163 added a commit that referenced this pull request Nov 22, 2025
Co-authored-by: 刘欢 <lh01217311@antgroup.com>
Co-authored-by: lijianan <574980606@qq.com>
Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: heming <984507092@qq.com>
Co-authored-by: 海绵 <hai.mian@yingdao.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
Co-authored-by: binghui.dbh <binghui.dbh@antgroup.com>
Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ice <1597834867@qq.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 叶文俊 <yewenjun@mistong.com>
Co-authored-by: 二货爱吃白萝卜 <smith3816@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com>
Co-authored-by: zjr222 <67370334+zjr222@users.noreply.github.com>
Co-authored-by: sheng zhang <79007994+Arktomson@users.noreply.github.com>
Co-authored-by: MadCcc <madccc@foxmail.com>
Co-authored-by: keda <53565274+Linkodt@users.noreply.github.com>
Co-authored-by: divyeshagrawal <138372682+divyeshagrawal@users.noreply.github.com>
Co-authored-by: xkhanhan <61129468+xkhanhan@users.noreply.github.com>
Co-authored-by: tanjiahao24 <90695367+tanjiahao24@users.noreply.github.com>
Co-authored-by: Susuper <susuperli@163.com>
Co-authored-by: ccc1018 <82812268+ccc1018@users.noreply.github.com>
Co-authored-by: GinWU <ginwu05@gmail.com>
Co-authored-by: lts <lts.lyc@qq.com>
Co-authored-by: nmsn <136696700@qq.com>
Co-authored-by: elrrrrrrr <elrrrrrrr@gmail.com>
Co-authored-by: 叶枫 <7971419+crazyair@users.noreply.github.com>
Co-authored-by: Wanpan <wanpan96@163.com>
Co-authored-by: 沐白 <13588781920@163.com>
Co-authored-by: heming <74885943+984507092@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: Guo Yunhe <i@guoyunhe.me>
fix popconfirm style (#55173)
fix typo of pannel to panel (#55178)
fix: leavedClassName classname when hidden (#55309)
fix(timeline): add missing orientation memo deps (#55449)
fix(collapse): add missing deps (#55452)
fix(menu): add missing contextValue memo deps (#55459)
fix: add splitter missing memo deps (#55486)
resolve console.error (#55488)
fix script (#55496)
fix: semantic of collapse (#55499)
fix: add divider missing memo deps (#55514)
fix: add progress missing memo deps (#55554)
fix: add tag useColor hooks missing memo deps (#55555)
fix: add PromptDrawer missing memo deps (#55556)
fix: add missing childrenColumnName dependency (#55559)
fix: Optimize the definition of the duration type (#55580)
fix(textarea): resize is invalid in styles.textarea (#55579)
fix Dynamic demo key calculte error (#55624)
fix: static css extract should order of Button (#55619)
fix missing addon (#55784)
fix: add missing dependency (#55782)
fix: update innerLoading to loading (#55789)
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.

2 participants