Skip to content

Conversation

@Queensbarry
Copy link

@Queensbarry Queensbarry commented Jan 8, 2026

Modify to ESM import to avoid import error. (e.g. #9344 and #9345)
Reference #9376 .

Summary by CodeRabbit

发布说明

  • 重构 / 日常维护
    • 统一并更新了内部模块的导入路径(迁移到 ES 模块路径),改善构建和按需打包友好性;运行行为不变。
    • 将若干工具包替换为另一个同类实现(如 classnames 替换 clsx)。
    • 部分演示与测试中的 locale 引入路径已更新,用户可用功能保持不变。

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

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 8, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

该 PR 将项目中大量 Ant Design 类型和 locale 的导入路径由 CommonJS/legacy (antd/lib/...) 迁移为 ES 模块路径 (antd/es/...),并在少数文件中将 clsx 替换为 classnames。未引入运行时行为或控制流变更。

Changes

Cohort / File(s) 变更摘要
全库 AntD 导入路径迁移
... (大量文件 across demos/, src/, tests/)
将多处类型与 locale 的导入从 antd/lib/... 切换为 antd/es/...(类型、locale、内部 util 等)。
示例/演示相关
demos/form/Dependency/dependency2.tsx, demos/form/QueryFilter/light-filter-footer.tsx, demos/form/QueryFilter/light-filter-test.tsx, demos/form/QueryFilter/light-filter.tsx, demos/form/config-provider.tsx, demos/form/form-layout-grid.tsx, demos/table/intl.tsx, demos/table/rtl_table.tsx
demo 文件中迁移类型与 locale 导入到 antd/es/...
表单核心与组件
src/form/** (例如 BaseForm/*, FieldContext.tsx, components/*, layouts/*)
批量更新 NamePath, FormLayout, RangePickerProps, SizeType, TooltipPlacement 等类型导入源;部分文件替换 clsxclassnames
表格/列表相关
src/table/**, src/list/**
GetRowKey, SortOrder, TableCurrentDataSource, ListGridType 等表格/列表类型导入切换为 antd/es/...;部分工具 hook/import 路径更新。
布局与工具/公用类型
src/layout/**, src/utils/**, src/provider/**, src/descriptions/index.tsx, src/card/typing.ts, src/field/components/Checkbox/index.tsx
更新 DirectionType, GlobalToken, LabelTooltipType, Breadcrumb 等多种类型的导入源;少量实现文件的 type 默认泛型引用路径改变。
测试调整
tests/** (例如 tests/card/index.test.tsx, tests/form/*, tests/layout/index.test.tsx, tests/setupTests.ts)
测试中 mock 路径与类型导入同步迁移至 antd/es/...

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 分钟

诗歌

🐰 我在树下轻敲键盘,
lib 朝着 es 跳起舞蹈,
clsx 换上 classNames 的帽,
小步改路径,大道不改貌,
欢庆一跃,代码更整齐。 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题清晰准确地总结了主要变更:从antd的lib路径更新到es路径,与所有61个文件的导入路径更新完全一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Queensbarry, 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 focuses on a significant refactoring of Ant Design imports throughout the codebase. By transitioning from CommonJS (antd/lib) to ECMAScript Modules (antd/es), the PR addresses known import errors and improves the overall module resolution and compatibility within the project. This update ensures that the application leverages modern JavaScript module standards more effectively.

Highlights

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

@Queensbarry Queensbarry changed the title Es import refactor: update antd import paths from lib to es Jan 8, 2026
@dosubot dosubot bot added the 🧱 antd label Jan 8, 2026
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 correctly updates Ant Design imports from antd/lib to antd/es across the project. This is a crucial change for ESM compatibility and can lead to better build optimizations. The changes are consistent and well-executed. I have one suggestion regarding a formatting change that seems out of scope for this PR, but overall, the changes are solid.

Comment on lines +1 to +2
/* eslint-disable react-hooks/exhaustive-deps */
import { LoadingOutlined } from '@ant-design/icons';
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This formatting change, which adds a newline after the eslint-disable comment, seems unrelated to the main purpose of this PR (updating to ESM imports). To keep the PR focused on a single concern, it's best to revert this change. If this is part of a broader code formatting effort, it would be better to address it in a separate PR. Mixing concerns in a single PR can make the commit history harder to follow.

Suggested change
/* eslint-disable react-hooks/exhaustive-deps */
import { LoadingOutlined } from '@ant-design/icons';
/* eslint-disable react-hooks/exhaustive-deps */ import { LoadingOutlined } from '@ant-design/icons';

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @src/layout/ProLayout.tsx:
- Around line 5-6: The import of AnyObject from the internal path
'antd/es/_util/type' is unstable; remove that import and replace usages of
AnyObject in ProLayout.tsx with a stable alternative such as a local type alias
(e.g. type AnyObject = Record<string, any> or unknown) or another public type
from your codebase, while keeping the ItemType import from
'antd/es/breadcrumb/Breadcrumb' as-is; update all references to AnyObject in the
file (e.g., prop and variable type annotations) to use the new alias so you no
longer depend on antd internal APIs.

In @src/utils/useEditableArray/index.tsx:
- Line 11: Remove the import of the internal antd type AnyObject and stop
referencing it; replace any occurrences of AnyObject in the useEditableArray
hook (e.g., parameter or return type annotations inside the useEditableArray
function and related symbols) with Record<string, any> or, better, a
domain-specific interface that describes the actual item shape, and update the
hook's generics/signatures (initialValue, items, onChange, etc.) accordingly so
no antd internal types are used and types are more precise.
- Line 13: The code uses the internal antd hook useLazyKVMap inside
useEditableArray which creates a version-compatibility risk; replace
useLazyKVMap with a new custom hook (e.g., implementUseKVMap or internal
useKeyRecordMap) that maintains a Map from keys to records, exposes
get/set/delete/has operations, and supports walking nested children to
populate/refresh mappings when the array changes; update useEditableArray to
import and call this custom hook instead of useLazyKVMap and ensure the API
mirrors the minimal methods currently used (lookup by key, lazy create if
needed, and reindex on data updates).
🧹 Nitpick comments (1)
src/form/components/DateRangePicker/DateTimeRangePicker.tsx (1)

1-1: 导入路径更新正确,建议改进导入方式。

ES 模块路径迁移正确。不过注意到与 BaseDateRanger.tsx 的导入方式不一致:该文件使用值导入语法,而 BaseDateRanger.tsx 使用类型导入语法(import type)。

♻️ 建议的改进:使用类型导入以保持一致性
-import { RangePickerProps } from 'antd/es/date-picker';
+import type { RangePickerProps } from 'antd/es/date-picker';

使用 import type 可以:

  • BaseDateRanger.tsx 保持一致
  • 改善 tree-shaking 效果
  • 遵循 TypeScript 最佳实践
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6113b0 and b319787.

📒 Files selected for processing (76)
  • demos/form/Dependency/dependency2.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • demos/form/config-provider.tsx
  • demos/form/form-layout-grid.tsx
  • demos/table/intl.tsx
  • demos/table/rtl_table.tsx
  • src/card/typing.ts
  • src/descriptions/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/BaseForm/BaseForm.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/form/FieldContext.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/DateRangePicker/DateQuarterRangePicker.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/form/components/DateRangePicker/index.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/FieldSet/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/List/ListItem.tsx
  • src/form/components/List/index.tsx
  • src/form/components/SchemaForm/typing.ts
  • src/form/components/Select/index.tsx
  • src/form/components/Slider/index.tsx
  • src/form/components/Text/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/layout/ProLayout.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • src/list/Item.tsx
  • src/list/ListView.tsx
  • src/list/index.tsx
  • src/provider/index.tsx
  • src/provider/useStyle/index.ts
  • src/table/Table.tsx
  • src/table/TableRender.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/table/components/EditableTable/CellEditorTable.tsx
  • src/table/components/EditableTable/RowEditorTable.tsx
  • src/table/components/EditableTable/index.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/table/components/ToolBar/index.tsx
  • src/table/typing.ts
  • src/table/utils/cellRenderToFromItem.tsx
  • src/table/utils/columnRender.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/utils/typing.ts
  • src/utils/useEditableArray/index.tsx
  • tests/card/index.test.tsx
  • tests/form/formList.test.tsx
  • tests/form/proFormMoney.test.tsx
  • tests/form/upload.test.tsx
  • tests/layout/index.test.tsx
  • tests/setupTests.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{tsx,jsx}: Use early returns whenever possible to make the code more readable.
Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
Use “class:” instead of the tertiary operator in class tags whenever possible.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.

Files:

  • src/list/ListView.tsx
  • tests/form/proFormMoney.test.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • tests/card/index.test.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/components/DateRangePicker/DateQuarterRangePicker.tsx
  • src/table/Table.tsx
  • tests/layout/index.test.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/ListItem.tsx
  • src/form/components/FieldSet/index.tsx
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • tests/form/formList.test.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/FieldContext.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • src/table/components/EditableTable/RowEditorTable.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • src/table/utils/columnRender.tsx
  • src/form/components/Captcha/index.tsx
  • tests/form/upload.test.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/Slider/index.tsx
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • src/table/components/EditableTable/CellEditorTable.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/table/utils/cellRenderToFromItem.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/AGENTS.md)

**/*.{ts,tsx}: Use TypeScript and React for development
Use early returns to improve code readability
Use camelCase for property names
Props naming: Use default + PropName for initialization properties
Props naming: Use forceRender for forced rendering
Props naming: Use force + SubComponentName + Render for sub-component forced rendering
Props naming: Use SubComponentName + Render for sub-component rendering
Props naming: Use dataSource for data sources
Props naming: Use open instead of visible for panel opening state
Props naming: Use show + PropName for display-related properties
Props naming: Use PropName + able for functional properties
Props naming: Use disabled for disabled state
Props naming: Use extra for additional content
Props naming: Use icon for icons
Props naming: Use trigger for triggers
Props naming: Use className for class names
Event naming: Use on + EventName for triggering events
Event naming: Use on + SubComponentName + EventName for sub-component events
Event naming: Use before + EventName for pre-action events
Event naming: Use after + EventName for post-action events
Event naming: Use on + EventName + Complete for continuous action completion
All components and functions must provide accurate type definitions
Avoid using any type, define types as precisely as possible
Use interface rather than type alias for defining object structures
Strictly follow TypeScript type design principles to ensure type safety
Ensure compilation without any type errors or warnings
Component props should be defined using interface for extensibility
Component props interface naming should follow ComponentNameProps convention
Define specialized interfaces for component state, such as ComponentNameState
Complex data structures should be split into multiple interface definitions
All callback function types should explicitly define parameters and return values
Appropriately use generics to enhance t...

Files:

  • src/list/ListView.tsx
  • tests/form/proFormMoney.test.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • tests/card/index.test.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/components/DateRangePicker/DateQuarterRangePicker.tsx
  • src/table/Table.tsx
  • tests/layout/index.test.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/ListItem.tsx
  • src/utils/typing.ts
  • src/form/components/FieldSet/index.tsx
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • tests/form/formList.test.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/FieldContext.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/EditableTable/RowEditorTable.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • src/table/utils/columnRender.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/SchemaForm/typing.ts
  • tests/form/upload.test.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/Slider/index.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • src/table/components/EditableTable/CellEditorTable.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
  • src/table/utils/cellRenderToFromItem.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/AGENTS.md)

All components must support dark mode

Files:

  • src/list/ListView.tsx
  • tests/form/proFormMoney.test.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • tests/card/index.test.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/components/DateRangePicker/DateQuarterRangePicker.tsx
  • src/table/Table.tsx
  • tests/layout/index.test.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/ListItem.tsx
  • src/utils/typing.ts
  • src/form/components/FieldSet/index.tsx
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • tests/form/formList.test.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/FieldContext.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/EditableTable/RowEditorTable.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • src/table/utils/columnRender.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/SchemaForm/typing.ts
  • tests/form/upload.test.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/Slider/index.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • src/table/components/EditableTable/CellEditorTable.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
  • src/table/utils/cellRenderToFromItem.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/AGENTS.md)

**/*.test.{ts,tsx}: Use Jest and React Testing Library for unit tests
Use snapshot testing for UI components

Files:

  • tests/form/proFormMoney.test.tsx
  • tests/card/index.test.tsx
  • tests/layout/index.test.tsx
  • tests/form/formList.test.tsx
  • tests/form/upload.test.tsx
**/*index.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/AGENTS.md)

Export all public interface types for user convenience

Files:

  • src/utils/components/FilterDropdown/index.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/FieldSet/index.tsx
  • src/form/components/List/index.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/Slider/index.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/provider/index.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • src/utils/useEditableArray/index.tsx
  • src/provider/useStyle/index.ts
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
🧠 Learnings (60)
📓 Common learnings
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Use `ant-design/cssinjs` as the styling solution
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use complete names rather than abbreviations in Antd naming
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Prioritize using antd built-in components in demos to reduce external dependencies
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use complete names rather than abbreviations in Antd naming

Applied to files:

  • src/list/ListView.tsx
  • tests/form/proFormMoney.test.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/components/DateRangePicker/DateQuarterRangePicker.tsx
  • src/table/Table.tsx
  • tests/layout/index.test.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/ListItem.tsx
  • src/utils/typing.ts
  • src/form/components/FieldSet/index.tsx
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • tests/form/formList.test.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/FieldContext.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • src/table/utils/columnRender.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/SchemaForm/typing.ts
  • tests/form/upload.test.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/Slider/index.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
  • src/table/utils/cellRenderToFromItem.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Prioritize using antd built-in components in demos to reduce external dependencies

Applied to files:

  • src/list/ListView.tsx
  • src/utils/components/FilterDropdown/index.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • tests/card/index.test.tsx
  • src/form/components/DateRangePicker/BaseDateRanger.tsx
  • src/form/components/Select/index.tsx
  • tests/layout/index.test.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/utils/typing.ts
  • src/form/components/FieldSet/index.tsx
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/table/components/ToolBar/index.tsx
  • tests/form/formList.test.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/form/BaseForm/LightWrapper/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DateRangePicker/DateWeekRangePicker.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • tests/form/upload.test.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/DateRangePicker/DateMonthRangePicker.tsx
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/form/components/DateRangePicker/DateYearRangePicker.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
  • src/table/utils/cellRenderToFromItem.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Demo import order: React → Dependencies → Component Library → Custom Components → Types → Styles

Applied to files:

  • src/list/ListView.tsx
  • src/form/components/Select/index.tsx
  • tests/layout/index.test.tsx
  • demos/table/intl.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/list/Item.tsx
  • src/form/components/Dependency/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • demos/form/config-provider.tsx
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • demos/form/Dependency/dependency2.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/form/components/TreeSelect/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Use `ant-design/cssinjs` as the styling solution

Applied to files:

  • src/list/ListView.tsx
  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/Select/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/utils/typing.ts
  • demos/table/intl.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/components/TextArea/index.tsx
  • tests/setupTests.ts
  • src/table/components/ListToolBar/index.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • src/table/TableRender.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use functional components and hooks, avoid class components

Applied to files:

  • src/list/ListView.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/index.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/Checkbox/index.tsx
  • src/form/components/Text/index.tsx
  • src/utils/useEditableArray/index.tsx
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use `useLocale` hook from `components/locale/index.tsx` to get localization configuration from global context

Applied to files:

  • tests/form/proFormMoney.test.tsx
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • tests/layout/index.test.tsx
  • demos/table/intl.tsx
  • src/form/components/DateRangePicker/TimeRangePicker.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/form/components/DatePicker/WeekPicker.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/DatePicker/TimePicker.tsx
  • demos/form/config-provider.tsx
  • src/layout/utils/getBreadcrumbProps.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/provider/index.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • demos/table/rtl_table.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/provider/useStyle/index.ts
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/locale/**/*_*.ts : When modifying localization configuration, update all language versions unless otherwise specified

Applied to files:

  • tests/form/proFormMoney.test.tsx
  • tests/layout/index.test.tsx
  • demos/table/intl.tsx
  • demos/form/config-provider.tsx
  • src/provider/index.tsx
  • demos/table/rtl_table.tsx
📚 Learning: 2025-08-01T09:28:29.050Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/test.mdc:0-0
Timestamp: 2025-08-01T09:28:29.050Z
Learning: Applies to test/**/* : Utilize Playwright fixtures (e.g., `test`, `page`, `expect`) to maintain test isolation and consistency.

Applied to files:

  • tests/form/proFormMoney.test.tsx
  • tests/card/index.test.tsx
  • tests/layout/index.test.tsx
  • tests/setupTests.ts
  • tests/form/upload.test.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.test.{ts,tsx} : Use Jest and React Testing Library for unit tests

Applied to files:

  • tests/form/proFormMoney.test.tsx
  • tests/card/index.test.tsx
  • tests/layout/index.test.tsx
  • tests/form/formList.test.tsx
  • tests/setupTests.ts
  • tests/form/upload.test.tsx
📚 Learning: 2025-08-01T09:28:29.050Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/test.mdc:0-0
Timestamp: 2025-08-01T09:28:29.050Z
Learning: Applies to test/**/* : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) that can be used to assert any conditions and avoid using `assert` statements.

Applied to files:

  • tests/form/proFormMoney.test.tsx
  • tests/card/index.test.tsx
  • tests/setupTests.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Use Ant Design's design token system in component styles

Applied to files:

  • src/table/utils/index.ts
  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/Select/index.tsx
  • src/utils/typing.ts
  • demos/table/intl.tsx
  • src/form/components/List/index.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/descriptions/index.tsx
  • tests/setupTests.ts
  • src/table/components/ListToolBar/index.tsx
  • demos/form/config-provider.tsx
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • src/provider/index.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/form/components/Text/index.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*index.{ts,tsx} : Export all public interface types for user convenience

Applied to files:

  • src/table/utils/index.ts
  • src/form/components/Select/index.tsx
  • src/table/Table.tsx
  • src/table/utils/genProColumnToColumn.tsx
  • src/list/Item.tsx
  • src/descriptions/index.tsx
  • tests/form/upload.test.tsx
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • src/table/TableRender.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Components should display well at different screen sizes

Applied to files:

  • src/utils/components/FieldLabel/index.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • src/card/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Support React 16 ~ 19 compatibility

Applied to files:

  • src/utils/components/FieldLabel/index.tsx
  • src/table/components/ColumnSetting/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/form/layouts/StepsForm/index.tsx
  • src/form/components/DateRangePicker/DateTimeRangePicker.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/utils/useEditableArray/index.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/layout/ProLayout.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `icon` for icons

Applied to files:

  • src/utils/components/FieldLabel/index.tsx
  • src/utils/typing.ts
  • src/form/components/List/index.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/layout/components/PageHeader/index.tsx
  • src/form/FieldContext.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/SchemaForm/typing.ts
  • src/layout/utils/getBreadcrumbProps.tsx
  • src/layout/components/SiderMenu/BaseMenu.tsx
  • src/card/typing.ts
📚 Learning: 2025-08-01T09:28:05.125Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/react.mdc:0-0
Timestamp: 2025-08-01T09:28:05.125Z
Learning: Applies to **/*.{tsx,jsx} : Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.

Applied to files:

  • src/table/components/ColumnSetting/index.tsx
  • src/utils/components/LabelIconTip/index.tsx
  • src/table/typing.ts
  • src/card/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Use functional components and hooks in demos

Applied to files:

  • src/table/components/ColumnSetting/index.tsx
  • tests/card/index.test.tsx
  • src/form/components/Select/index.tsx
  • src/form/layouts/QueryFilter/index.tsx
  • src/field/components/Checkbox/index.tsx
  • src/form/components/List/index.tsx
  • src/form/layouts/LightFilter/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/form/components/Dependency/index.tsx
  • src/form/components/UploadDragger/index.tsx
  • src/descriptions/index.tsx
  • src/table/components/ListToolBar/index.tsx
  • src/form/components/Checkbox/index.tsx
  • demos/form/config-provider.tsx
  • demos/form/form-layout-grid.tsx
  • src/form/components/Slider/index.tsx
  • src/form/components/Text/index.tsx
  • src/list/index.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
  • src/form/components/TreeSelect/index.tsx
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Component ref types should be explicitly defined using `React.ForwardRefRenderFunction`

Applied to files:

  • src/table/components/ColumnSetting/index.tsx
  • src/form/components/List/index.tsx
  • src/form/components/TextArea/index.tsx
  • src/form/components/Text/index.tsx
  • src/utils/useEditableArray/index.tsx
  • src/card/typing.ts
  • src/form/components/TreeSelect/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.test.{ts,tsx} : Use snapshot testing for UI components

Applied to files:

  • tests/card/index.test.tsx
  • tests/layout/index.test.tsx
  • tests/form/formList.test.tsx
  • tests/setupTests.ts
  • tests/form/upload.test.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Add necessary test cases for PR changes

Applied to files:

  • tests/card/index.test.tsx
📚 Learning: 2025-08-01T09:28:29.050Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/test.mdc:0-0
Timestamp: 2025-08-01T09:28:29.050Z
Learning: Applies to test/**/* : Use `test.beforeEach` and `test.afterEach` for setup and teardown to ensure a clean state for each test.

Applied to files:

  • tests/card/index.test.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Use literal union types to define limited option sets

Applied to files:

  • src/form/components/Select/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Rely on TypeScript's type inference as much as possible

Applied to files:

  • src/form/components/Select/index.tsx
  • src/utils/typing.ts
  • src/table/typing.ts
  • src/form/components/DateRangePicker/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Place test files in the **tests** directory with naming format: index.test.tsx or xxx.test.tsx

Applied to files:

  • tests/layout/index.test.tsx
📚 Learning: 2025-12-31T17:05:16.571Z
Learnt from: zzjiaxiang
Repo: ant-design/pro-components PR: 9371
File: demos/form/StepsForm/steps-from.tsx:49-49
Timestamp: 2025-12-31T17:05:16.571Z
Learning: Ant Design v6 Steps StepItem uses `content` for per-step text and deprecates `description`; in ProComponents, StepsForm.StepForm stepProps should prefer `content` over `description`.

Applied to files:

  • src/form/layouts/StepsForm/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Strictly follow TypeScript type design principles to ensure type safety

Applied to files:

  • src/utils/typing.ts
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
  • src/layout/ProLayout.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : All components and functions must provide accurate type definitions

Applied to files:

  • src/utils/typing.ts
  • src/form/components/Slider/index.tsx
  • src/table/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Appropriately use generics to enhance type flexibility

Applied to files:

  • src/utils/typing.ts
  • src/table/utils/genProColumnToColumn.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Avoid using `any` type, define types as precisely as possible

Applied to files:

  • src/utils/typing.ts
  • src/table/utils/columnRender.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Support TypeScript 4.0+

Applied to files:

  • src/utils/typing.ts
  • src/form/layouts/LightFilter/index.tsx
  • src/table/typing.ts
  • demos/form/QueryFilter/light-filter-footer.tsx
  • src/card/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Define specialized interfaces for component state, such as `ComponentNameState`

Applied to files:

  • src/utils/typing.ts
  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/table/components/EditableTable/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/FieldContext.tsx
  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Define clear interfaces for complex data types in demos, avoid `any`

Applied to files:

  • src/utils/typing.ts
  • src/table/typing.ts
  • src/table/TableRender.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
  • demos/form/QueryFilter/light-filter.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Component props should be defined using interface for extensibility

Applied to files:

  • src/utils/typing.ts
  • src/form/components/List/index.tsx
  • src/form/FieldContext.tsx
  • src/form/components/SchemaForm/typing.ts
  • src/card/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/locale/**/*_*.ts : Localization configuration content is typically plain strings

Applied to files:

  • demos/table/intl.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Avoid redundant code in demos for convenient copying to projects

Applied to files:

  • demos/table/intl.tsx
  • tests/setupTests.ts
  • demos/form/config-provider.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Clean up side effects in demos

Applied to files:

  • demos/table/intl.tsx
  • demos/form/config-provider.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Component props interface naming should follow `ComponentNameProps` convention

Applied to files:

  • src/form/BaseForm/BaseForm.tsx
  • src/utils/components/ProFormContext/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/FieldContext.tsx
  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Use interface rather than type alias for defining object structures

Applied to files:

  • src/form/BaseForm/BaseForm.tsx
  • tests/form/formList.test.tsx
  • src/list/Item.tsx
  • src/form/components/SchemaForm/typing.ts
  • tests/form/upload.test.tsx
  • src/utils/conversionMomentValue/index.ts
  • src/table/typing.ts
  • src/table/TableRender.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use PascalCase for component names

Applied to files:

  • src/form/BaseForm/BaseForm.tsx
  • src/form/components/TextArea/index.tsx
  • src/form/components/FormItem/index.tsx
  • src/form/components/Captcha/index.tsx
  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Components should support right-to-left (RTL) reading direction

Applied to files:

  • src/layout/components/PageHeader/index.tsx
  • demos/table/rtl_table.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx,ts} : All components must support dark mode

Applied to files:

  • src/form/layouts/LightFilter/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Token modifications should propagate downward to ensure design system consistency

Applied to files:

  • src/form/components/TextArea/index.tsx
  • src/layout/ProLayout.tsx
  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Components should provide a `ref` attribute with structure including `nativeElement`, `focus`, and other functions

Applied to files:

  • src/form/components/TextArea/index.tsx
  • src/form/components/Text/index.tsx
  • src/form/components/TreeSelect/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Appropriately use React.memo, useMemo, and useCallback for performance optimization

Applied to files:

  • src/table/components/EditableTable/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `PropName` + `able` for functional properties

Applied to files:

  • src/form/FieldContext.tsx
  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Avoid hardcoding colors, sizes, spacing, and other values

Applied to files:

  • tests/setupTests.ts
  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Use camelCase for property names

Applied to files:

  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `default` + `PropName` for initialization properties

Applied to files:

  • src/form/components/SchemaForm/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/demo/**/*.tsx : Demo should showcase main component usage scenarios

Applied to files:

  • demos/form/config-provider.tsx
  • demos/form/Dependency/dependency2.tsx
  • demos/form/QueryFilter/light-filter-footer.tsx
  • demos/form/QueryFilter/light-filter-test.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{tsx} : Use rc-motion for complex animations

Applied to files:

  • src/form/components/Slider/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `dataSource` for data sources

Applied to files:

  • src/table/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/locale/**/*_*.ts : Localization configuration file naming rule: `*_*.ts`, such as `zh_CN.ts`

Applied to files:

  • src/provider/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `force` + `SubComponentName` + `Render` for sub-component forced rendering

Applied to files:

  • src/form/components/Text/index.tsx
  • src/form/components/TreeSelect/index.tsx
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*.{ts,tsx} : Props naming: Use `open` instead of `visible` for panel opening state

Applied to files:

  • src/card/typing.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Component styles should be based on global tokens and component-level tokens

Applied to files:

  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Custom styles should use existing tokens as much as possible to maintain consistency

Applied to files:

  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Style generation functions should follow `gen[ComponentName]Style` naming convention

Applied to files:

  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Component Token naming format: `variant (optional)` + `semantic part` + `semantic part variant (optional)` + `css property` + `size/disabled (optional)`

Applied to files:

  • src/provider/useStyle/index.ts
📚 Learning: 2025-12-26T06:32:24.230Z
Learnt from: CR
Repo: ant-design/pro-components PR: 0
File: .cursor/rules/AGENTS.md:0-0
Timestamp: 2025-12-26T06:32:24.230Z
Learning: Applies to **/*style*.{ts,tsx} : Component-level token naming convention: `Component` + property name, such as `buttonPrimaryColor`

Applied to files:

  • src/provider/useStyle/index.ts

import type { NamePath } from 'antd/lib/form/interface';
import useLazyKVMap from 'antd/lib/table/hooks/useLazyKVMap';
import type { GetRowKey } from 'antd/lib/table/interface';
import { AnyObject } from 'antd/es/_util/type';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# 1. 检查文件内容和导入
echo "=== 检查目标文件内容 ==="
if [ -f "src/utils/useEditableArray/index.tsx" ]; then
  echo "文件存在,显示前30行及导入部分:"
  head -30 "src/utils/useEditableArray/index.tsx" | cat -n
  echo ""
  echo "=== 搜索 AnyObject 的使用位置 ==="
  rg "AnyObject" "src/utils/useEditableArray/index.tsx" -n -B 2 -A 2
else
  echo "文件不存在"
fi

echo ""
echo "=== 检查 AnyObject 在整个代码库中的使用 ==="
rg "from 'antd/es/_util/type'" --type=ts --type=tsx | head -20

echo ""
echo "=== 检查是否有其他 antd 内部路径的导入 ==="
rg "from 'antd/es/" "src/utils/" --type=ts --type=tsx | grep -v "from 'antd/es/[^/]*'" | head -20

Repository: ant-design/pro-components

Length of output: 1933


🌐 Web query:

antd AnyObject type definition public API documentation

💡 Result:

The AnyObject type in antd is defined as:
type AnyObject = Record<PropertyKey, any>;

(Located in antd's type utility file: es/_util/type.d.ts). [1]

Sources:
[1] antd es/_util/type.d.ts (AnyObject = Record<PropertyKey, any>). [2]
[2] Example usage importing AnyObject from antd internal util in component typings (e.g. lib/flex/interface.d.ts).


建议避免使用 antd 内部类型,改用 Record<string, any> 或定义更精确的类型

antd/es/_util/type 导入 AnyObject 使用的是 antd 内部 API(定义为 Record<PropertyKey, any>),这不属于公共 API,可能在 antd 未来版本中发生变更。此外,直接使用 any 类型也与编码规范"避免使用 any 类型,尽可能精确定义类型"相违背。

建议改用 Record<string, any> 替代,或根据实际数据结构定义更精确的接口类型。

🤖 Prompt for AI Agents
In @src/utils/useEditableArray/index.tsx at line 11, Remove the import of the
internal antd type AnyObject and stop referencing it; replace any occurrences of
AnyObject in the useEditableArray hook (e.g., parameter or return type
annotations inside the useEditableArray function and related symbols) with
Record<string, any> or, better, a domain-specific interface that describes the
actual item shape, and update the hook's generics/signatures (initialValue,
items, onChange, etc.) accordingly so no antd internal types are used and types
are more precise.

import type { GetRowKey } from 'antd/lib/table/interface';
import { AnyObject } from 'antd/es/_util/type';
import type { NamePath } from 'antd/es/form/interface';
import useLazyKVMap from 'antd/es/table/hooks/useLazyKVMap';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's examine the file in question
echo "=== File content: src/utils/useEditableArray/index.tsx ==="
cat -n src/utils/useEditableArray/index.tsx | head -40

Repository: ant-design/pro-components

Length of output: 1617


🏁 Script executed:

#!/bin/bash
# Search for useLazyKVMap usage in the codebase
echo "=== Searching for useLazyKVMap usage ==="
rg "useLazyKVMap" --type=ts --type=tsx -B 2 -A 10

Repository: ant-design/pro-components

Length of output: 154


🏁 Script executed:

#!/bin/bash
# Check the structure of antd exports
echo "=== Check if antd exports or documents this API ==="
fd "package.json" --type f | grep antd

Repository: ant-design/pro-components

Length of output: 120


🌐 Web query:

antd useLazyKVMap internal hook alternatives public API

💡 Result:

Short answer: useLazyKVMap is an internal (non‑public) hook from antd’s table implementation — don’t rely on it. Instead use public APIs or simple local utilities:

  • Use Table props (rowKey / getRowKey) + dataSource to build your own id→record map (simple Map or object) when you need O(1) lookup. This is the supported pattern. [1][2]
  • For per‑row state inside custom renderers, pass the row record or key into renderers (record, index, rowKey) rather than reading internal hooks. [2]
  • If you need lazy resolution of keys→labels/options for selects/filters, implement a lightweight custom hook (useRef + Map + useEffect to populate on demand) — same behavior as useLazyKVMap but under your control and stable across antd versions. (No public antd replacement exists.) [1]

Sources:

  1. antd package file listing showing useLazyKVMap exists under table/hooks (internal). [unpkg listing]. [1]
  2. Ant Design Table docs (rowKey / dataSource / render patterns). [2]

References:
[1] antd table hooks listing (unpkg).
[2] Ant Design Table docs — usage of rowKey, dataSource, render.


🌐 Web query:

antd table hooks useLazyKVMap documentation

💡 Result:

useLazyKVMap is an internal Ant Design Table hook that builds a lazy key→record lookup for table rows (including nested children). Signature (from the compiled d.ts):

export default function useLazyKVMap(
data: readonly RecordType[],
childrenColumnName: string,
getRowKey: GetRowKey
): ((key: Key) => RecordType)[];

  • data: table dataSource (readonly array).
  • childrenColumnName: name of the nested-children field (e.g. "children").
  • getRowKey: function or key to derive each row's unique Key.
  • returns: an array of functions of shape (key: Key) => RecordType used by table internals to resolve records by key lazily. [1]

You can inspect the compiled declaration on unpkg for the exact typing. For general Table API/context see the Ant Design Table docs. [1][2]

Sources:
[1] antd useLazyKVMap.d.ts (unpkg).
[2] Ant Design Table documentation.


🏁 Script executed:

#!/bin/bash
# View the complete file to see useLazyKVMap usage
wc -l src/utils/useEditableArray/index.tsx

Repository: ant-design/pro-components

Length of output: 110


🏁 Script executed:

#!/bin/bash
# View the file with line numbers, focusing on useLazyKVMap usage
cat -n src/utils/useEditableArray/index.tsx | grep -A 20 -B 5 "useLazyKVMap"

Repository: ant-design/pro-components

Length of output: 2041


🏁 Script executed:

#!/bin/bash
# Look for the function definition and see where useLazyKVMap is called
grep -n "useLazyKVMap\|const.*=" src/utils/useEditableArray/index.tsx | head -20

Repository: ant-design/pro-components

Length of output: 1138


🏁 Script executed:

#!/bin/bash
# Let's check if there's already a custom implementation or workaround elsewhere in the codebase
echo "=== Search for key-to-record mapping patterns in the codebase ==="
rg "getRowKey|getRecordByKey" --type ts --max-count 5

Repository: ant-design/pro-components

Length of output: 2691


🏁 Script executed:

#!/bin/bash
# Check if there are any other antd internal hook imports to see the pattern
echo "=== Check for other antd internal imports ==="
rg "from 'antd/es.*hooks" src/ --type ts --type tsx

Repository: ant-design/pro-components

Length of output: 159


🏁 Script executed:

#!/bin/bash
# Check ListView.tsx to see other usages
echo "=== View useLazyKVMap usage in ListView.tsx ==="
grep -n "useLazyKVMap\|getRecordByKey" src/list/ListView.tsx | head -20

Repository: ant-design/pro-components

Length of output: 286


🏁 Script executed:

#!/bin/bash
# Get broader view of useLazyKVMap imports across the entire project
echo "=== All useLazyKVMap imports in the project ==="
rg "useLazyKVMap" --type ts -l

Repository: ant-design/pro-components

Length of output: 175


🏁 Script executed:

#!/bin/bash
# Let's see the exact implementation to understand what we need to replace
cat -n src/utils/useEditableArray/index.tsx | sed -n '750,780p'

Repository: ant-design/pro-components

Length of output: 1085


使用 antd 内部 Hook 会导致版本兼容性问题

useLazyKVMap 来自 antd/es/table/hooks/,属于 antd 的内部实现而非公共 API。此 Hook 存在以下风险:

  1. antd 版本更新时可能被移除或修改,不提供向后兼容保证
  2. 在 pro-components 用户升级 antd 时会导致破坏性变更
  3. 当前没有稳定的公共 API 替代方案

建议实现一个自定义 Hook 来替代 useLazyKVMap,基于简单的 Map 实现关键字到记录的映射,同时支持嵌套子项。这样可以将代码与 antd 内部实现解耦,提高版本稳定性。

🤖 Prompt for AI Agents
In @src/utils/useEditableArray/index.tsx at line 13, The code uses the internal
antd hook useLazyKVMap inside useEditableArray which creates a
version-compatibility risk; replace useLazyKVMap with a new custom hook (e.g.,
implementUseKVMap or internal useKeyRecordMap) that maintains a Map from keys to
records, exposes get/set/delete/has operations, and supports walking nested
children to populate/refresh mappings when the array changes; update
useEditableArray to import and call this custom hook instead of useLazyKVMap and
ensure the API mirrors the minimal methods currently used (lookup by key, lazy
create if needed, and reindex on data updates).

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 20, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/form/components/List/index.tsx (1)

251-251: 严重错误:clsx 未定义。

第 17 行导入了 classNames,但此处仍使用 clsx。这会导致运行时 ReferenceError

🐛 修复建议
-        <div className={clsx(baseClassName, hashId)} style={style}>
+        <div className={classNames(baseClassName, hashId)} style={style}>
src/form/BaseForm/LightWrapper/index.tsx (1)

143-143: 严重错误:clsx 未定义。

第 3 行已将导入从 clsx 改为 classNames,但此处仍使用 clsx(),这会导致 ReferenceError: clsx is not defined 运行时错误。

🐛 修复方案
-        className={clsx(`${prefixCls}-container`, hashId, className)}
+        className={classNames(`${prefixCls}-container`, hashId, className)}
🤖 Fix all issues with AI agents
In `@src/form/BaseForm/LightWrapper/index.tsx`:
- Around line 2-3: You imported classNames but the code still calls clsx,
causing a runtime error; update the usage by replacing any references to clsx
with classNames (or rename the import to clsx if you prefer) so the identifier
matches the import; specifically, change the call site where clsx(...) is used
to classNames(...) and ensure the import remains: import classNames from
'classnames';.

Comment on lines 2 to 3
import type { TooltipPlacement } from 'antd/es/tooltip';
import classNames from 'classnames';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

ESM 导入路径更新正确,但 classNames 导入存在后续使用问题。

antd/lib/tooltip 改为 antd/es/tooltip 符合 PR 目标。但是,clsx 被替换为 classNames 后,第 143 行仍然引用了 clsx,这会导致运行时错误。

🐛 修复建议
-import classNames from 'classnames';
+import clsx from 'clsx';

或者保持 classNames 导入,并修改第 143 行的使用:

-        className={clsx(`${prefixCls}-container`, hashId, className)}
+        className={classNames(`${prefixCls}-container`, hashId, className)}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { TooltipPlacement } from 'antd/es/tooltip';
import classNames from 'classnames';
import type { TooltipPlacement } from 'antd/es/tooltip';
import clsx from 'clsx';
🤖 Prompt for AI Agents
In `@src/form/BaseForm/LightWrapper/index.tsx` around lines 2 - 3, You imported
classNames but the code still calls clsx, causing a runtime error; update the
usage by replacing any references to clsx with classNames (or rename the import
to clsx if you prefer) so the identifier matches the import; specifically,
change the call site where clsx(...) is used to classNames(...) and ensure the
import remains: import classNames from 'classnames';.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 antd size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant