-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor: update antd import paths from lib to es #9382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthrough该 PR 将项目中大量 Ant Design 类型和 locale 的导入路径由 CommonJS/legacy ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 分钟 诗歌
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello @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 ( 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 AssistThe 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
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 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
|
There was a problem hiding this 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.
| /* eslint-disable react-hooks/exhaustive-deps */ | ||
| import { LoadingOutlined } from '@ant-design/icons'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| /* eslint-disable react-hooks/exhaustive-deps */ | |
| import { LoadingOutlined } from '@ant-design/icons'; | |
| /* eslint-disable react-hooks/exhaustive-deps */ import { LoadingOutlined } from '@ant-design/icons'; |
There was a problem hiding this 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
📒 Files selected for processing (76)
demos/form/Dependency/dependency2.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/form/QueryFilter/light-filter.tsxdemos/form/config-provider.tsxdemos/form/form-layout-grid.tsxdemos/table/intl.tsxdemos/table/rtl_table.tsxsrc/card/typing.tssrc/descriptions/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/BaseForm/BaseForm.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/form/FieldContext.tsxsrc/form/components/Captcha/index.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/DateRangePicker/DateQuarterRangePicker.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/form/components/DateRangePicker/index.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/FieldSet/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/List/ListItem.tsxsrc/form/components/List/index.tsxsrc/form/components/SchemaForm/typing.tssrc/form/components/Select/index.tsxsrc/form/components/Slider/index.tsxsrc/form/components/Text/index.tsxsrc/form/components/TextArea/index.tsxsrc/form/components/TreeSelect/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/layouts/StepsForm/index.tsxsrc/layout/ProLayout.tsxsrc/layout/components/PageHeader/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/layout/utils/getBreadcrumbProps.tsxsrc/list/Item.tsxsrc/list/ListView.tsxsrc/list/index.tsxsrc/provider/index.tsxsrc/provider/useStyle/index.tssrc/table/Table.tsxsrc/table/TableRender.tsxsrc/table/components/ColumnSetting/index.tsxsrc/table/components/EditableTable/CellEditorTable.tsxsrc/table/components/EditableTable/RowEditorTable.tsxsrc/table/components/EditableTable/index.tsxsrc/table/components/ListToolBar/index.tsxsrc/table/components/ToolBar/index.tsxsrc/table/typing.tssrc/table/utils/cellRenderToFromItem.tsxsrc/table/utils/columnRender.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/utils/components/ProFormContext/index.tsxsrc/utils/conversionMomentValue/index.tssrc/utils/typing.tssrc/utils/useEditableArray/index.tsxtests/card/index.test.tsxtests/form/formList.test.tsxtests/form/proFormMoney.test.tsxtests/form/upload.test.tsxtests/layout/index.test.tsxtests/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.tsxtests/form/proFormMoney.test.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxtests/card/index.test.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/components/DateRangePicker/DateQuarterRangePicker.tsxsrc/table/Table.tsxtests/layout/index.test.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/ListItem.tsxsrc/form/components/FieldSet/index.tsxdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/form/BaseForm/BaseForm.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxtests/form/formList.test.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/FieldContext.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxsrc/table/components/EditableTable/RowEditorTable.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxsrc/table/utils/columnRender.tsxsrc/form/components/Captcha/index.tsxtests/form/upload.test.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxdemos/form/form-layout-grid.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/Slider/index.tsxsrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxsrc/table/components/EditableTable/CellEditorTable.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/Dependency/dependency2.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/table/utils/cellRenderToFromItem.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/form/components/TreeSelect/index.tsxsrc/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: Usedefault+PropNamefor initialization properties
Props naming: UseforceRenderfor forced rendering
Props naming: Useforce+SubComponentName+Renderfor sub-component forced rendering
Props naming: UseSubComponentName+Renderfor sub-component rendering
Props naming: UsedataSourcefor data sources
Props naming: Useopeninstead ofvisiblefor panel opening state
Props naming: Useshow+PropNamefor display-related properties
Props naming: UsePropName+ablefor functional properties
Props naming: Usedisabledfor disabled state
Props naming: Useextrafor additional content
Props naming: Useiconfor icons
Props naming: Usetriggerfor triggers
Props naming: UseclassNamefor class names
Event naming: Useon+EventNamefor triggering events
Event naming: Useon+SubComponentName+EventNamefor sub-component events
Event naming: Usebefore+EventNamefor pre-action events
Event naming: Useafter+EventNamefor post-action events
Event naming: Useon+EventName+Completefor continuous action completion
All components and functions must provide accurate type definitions
Avoid usinganytype, 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 followComponentNamePropsconvention
Define specialized interfaces for component state, such asComponentNameState
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.tsxtests/form/proFormMoney.test.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxtests/card/index.test.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/components/DateRangePicker/DateQuarterRangePicker.tsxsrc/table/Table.tsxtests/layout/index.test.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/ListItem.tsxsrc/utils/typing.tssrc/form/components/FieldSet/index.tsxdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/form/BaseForm/BaseForm.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxtests/form/formList.test.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/FieldContext.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/EditableTable/RowEditorTable.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxsrc/table/utils/columnRender.tsxsrc/form/components/Captcha/index.tsxsrc/form/components/SchemaForm/typing.tstests/form/upload.test.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxdemos/form/form-layout-grid.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/Slider/index.tsxsrc/utils/conversionMomentValue/index.tssrc/table/typing.tssrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxsrc/table/components/EditableTable/CellEditorTable.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/Dependency/dependency2.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/card/typing.tssrc/table/utils/cellRenderToFromItem.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/provider/useStyle/index.tssrc/form/components/TreeSelect/index.tsxsrc/form/components/DateRangePicker/index.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/AGENTS.md)
All components must support dark mode
Files:
src/list/ListView.tsxtests/form/proFormMoney.test.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxtests/card/index.test.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/components/DateRangePicker/DateQuarterRangePicker.tsxsrc/table/Table.tsxtests/layout/index.test.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/ListItem.tsxsrc/utils/typing.tssrc/form/components/FieldSet/index.tsxdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/form/BaseForm/BaseForm.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxtests/form/formList.test.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/FieldContext.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/EditableTable/RowEditorTable.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxsrc/table/utils/columnRender.tsxsrc/form/components/Captcha/index.tsxsrc/form/components/SchemaForm/typing.tstests/form/upload.test.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxdemos/form/form-layout-grid.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/Slider/index.tsxsrc/utils/conversionMomentValue/index.tssrc/table/typing.tssrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxsrc/table/components/EditableTable/CellEditorTable.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/Dependency/dependency2.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/card/typing.tssrc/table/utils/cellRenderToFromItem.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/provider/useStyle/index.tssrc/form/components/TreeSelect/index.tsxsrc/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.tsxtests/card/index.test.tsxtests/layout/index.test.tsxtests/form/formList.test.tsxtests/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.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/FieldSet/index.tsxsrc/form/components/List/index.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/Captcha/index.tsxsrc/form/components/Slider/index.tsxsrc/utils/conversionMomentValue/index.tssrc/provider/index.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxsrc/utils/useEditableArray/index.tsxsrc/provider/useStyle/index.tssrc/form/components/TreeSelect/index.tsxsrc/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.tsxtests/form/proFormMoney.test.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/components/DateRangePicker/DateQuarterRangePicker.tsxsrc/table/Table.tsxtests/layout/index.test.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/ListItem.tsxsrc/utils/typing.tssrc/form/components/FieldSet/index.tsxdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/form/BaseForm/BaseForm.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxtests/form/formList.test.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/FieldContext.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/ListToolBar/index.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxsrc/table/utils/columnRender.tsxsrc/form/components/Captcha/index.tsxsrc/form/components/SchemaForm/typing.tstests/form/upload.test.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxdemos/form/form-layout-grid.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/Slider/index.tsxsrc/utils/conversionMomentValue/index.tssrc/table/typing.tssrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/Dependency/dependency2.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/card/typing.tssrc/table/utils/cellRenderToFromItem.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/provider/useStyle/index.tssrc/form/components/TreeSelect/index.tsxsrc/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.tsxsrc/utils/components/FilterDropdown/index.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxtests/card/index.test.tsxsrc/form/components/DateRangePicker/BaseDateRanger.tsxsrc/form/components/Select/index.tsxtests/layout/index.test.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/utils/typing.tssrc/form/components/FieldSet/index.tsxdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/table/components/ToolBar/index.tsxtests/form/formList.test.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/form/BaseForm/LightWrapper/index.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/ListToolBar/index.tsxsrc/form/components/DateRangePicker/DateWeekRangePicker.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/DatePicker/TimePicker.tsxtests/form/upload.test.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxdemos/form/form-layout-grid.tsxsrc/form/components/DateRangePicker/DateMonthRangePicker.tsxsrc/form/components/Slider/index.tsxsrc/table/typing.tssrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/Dependency/dependency2.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/form/components/DateRangePicker/DateYearRangePicker.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/card/typing.tssrc/table/utils/cellRenderToFromItem.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/form/components/TreeSelect/index.tsxsrc/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.tsxsrc/form/components/Select/index.tsxtests/layout/index.test.tsxdemos/table/intl.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/list/Item.tsxsrc/form/components/Dependency/index.tsxsrc/descriptions/index.tsxtests/setupTests.tsdemos/form/config-provider.tsxsrc/form/components/Slider/index.tsxsrc/table/typing.tsdemos/form/Dependency/dependency2.tsxdemos/form/QueryFilter/light-filter-footer.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/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.tsxsrc/table/utils/index.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/components/Select/index.tsxsrc/field/components/Checkbox/index.tsxsrc/utils/typing.tsdemos/table/intl.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/components/TextArea/index.tsxtests/setupTests.tssrc/table/components/ListToolBar/index.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxsrc/form/components/Slider/index.tsxsrc/table/typing.tssrc/provider/index.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxsrc/table/TableRender.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/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.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/StepsForm/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/index.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/Checkbox/index.tsxsrc/form/components/Text/index.tsxsrc/utils/useEditableArray/index.tsxsrc/form/components/TreeSelect/index.tsxsrc/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.tsxsrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxtests/layout/index.test.tsxdemos/table/intl.tsxsrc/form/components/DateRangePicker/TimeRangePicker.tsxsrc/layout/components/PageHeader/index.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/components/TextArea/index.tsxsrc/table/components/EditableTable/index.tsxsrc/form/components/DatePicker/WeekPicker.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/ListToolBar/index.tsxsrc/form/components/DatePicker/TimePicker.tsxdemos/form/config-provider.tsxsrc/layout/utils/getBreadcrumbProps.tsxsrc/utils/conversionMomentValue/index.tssrc/provider/index.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxdemos/table/rtl_table.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/form/QueryFilter/light-filter.tsxsrc/provider/useStyle/index.tssrc/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.tsxtests/layout/index.test.tsxdemos/table/intl.tsxdemos/form/config-provider.tsxsrc/provider/index.tsxdemos/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.tsxtests/card/index.test.tsxtests/layout/index.test.tsxtests/setupTests.tstests/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.tsxtests/card/index.test.tsxtests/layout/index.test.tsxtests/form/formList.test.tsxtests/setupTests.tstests/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.tsxtests/card/index.test.tsxtests/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.tssrc/utils/components/FieldLabel/index.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/components/Select/index.tsxsrc/utils/typing.tsdemos/table/intl.tsxsrc/form/components/List/index.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/components/TextArea/index.tsxsrc/descriptions/index.tsxtests/setupTests.tssrc/table/components/ListToolBar/index.tsxdemos/form/config-provider.tsxsrc/form/components/Slider/index.tsxsrc/table/typing.tssrc/provider/index.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/form/components/Text/index.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/card/typing.tsdemos/form/QueryFilter/light-filter.tsxsrc/layout/ProLayout.tsxsrc/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.tssrc/form/components/Select/index.tsxsrc/table/Table.tsxsrc/table/utils/genProColumnToColumn.tsxsrc/list/Item.tsxsrc/descriptions/index.tsxtests/form/upload.test.tsxsrc/form/components/Slider/index.tsxsrc/table/typing.tssrc/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.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/form/QueryFilter/light-filter-test.tsxsrc/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.tsxsrc/table/components/ColumnSetting/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/form/layouts/StepsForm/index.tsxsrc/form/components/DateRangePicker/DateTimeRangePicker.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/table/components/EditableTable/index.tsxsrc/table/components/ListToolBar/index.tsxsrc/utils/useEditableArray/index.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/form/QueryFilter/light-filter.tsxsrc/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.tsxsrc/utils/typing.tssrc/form/components/List/index.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/layout/components/PageHeader/index.tsxsrc/form/FieldContext.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/SchemaForm/typing.tssrc/layout/utils/getBreadcrumbProps.tsxsrc/layout/components/SiderMenu/BaseMenu.tsxsrc/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.tsxsrc/utils/components/LabelIconTip/index.tsxsrc/table/typing.tssrc/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.tsxtests/card/index.test.tsxsrc/form/components/Select/index.tsxsrc/form/layouts/QueryFilter/index.tsxsrc/field/components/Checkbox/index.tsxsrc/form/components/List/index.tsxsrc/form/layouts/LightFilter/index.tsxsrc/form/components/TextArea/index.tsxsrc/form/components/Dependency/index.tsxsrc/form/components/UploadDragger/index.tsxsrc/descriptions/index.tsxsrc/table/components/ListToolBar/index.tsxsrc/form/components/Checkbox/index.tsxdemos/form/config-provider.tsxdemos/form/form-layout-grid.tsxsrc/form/components/Slider/index.tsxsrc/form/components/Text/index.tsxsrc/list/index.tsxdemos/form/Dependency/dependency2.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/form/QueryFilter/light-filter.tsxsrc/form/components/TreeSelect/index.tsxsrc/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.tsxsrc/form/components/List/index.tsxsrc/form/components/TextArea/index.tsxsrc/form/components/Text/index.tsxsrc/utils/useEditableArray/index.tsxsrc/card/typing.tssrc/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.tsxtests/layout/index.test.tsxtests/form/formList.test.tsxtests/setupTests.tstests/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.tsxsrc/utils/typing.tssrc/table/typing.tssrc/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.tssrc/form/components/Slider/index.tsxsrc/table/typing.tssrc/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.tssrc/form/components/Slider/index.tsxsrc/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.tssrc/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.tssrc/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.tssrc/form/layouts/LightFilter/index.tsxsrc/table/typing.tsdemos/form/QueryFilter/light-filter-footer.tsxsrc/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.tssrc/form/BaseForm/BaseForm.tsxsrc/utils/components/ProFormContext/index.tsxsrc/table/components/EditableTable/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/FieldContext.tsxsrc/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.tssrc/table/typing.tssrc/table/TableRender.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/form/QueryFilter/light-filter-test.tsxdemos/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.tssrc/form/components/List/index.tsxsrc/form/FieldContext.tsxsrc/form/components/SchemaForm/typing.tssrc/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.tsxtests/setupTests.tsdemos/form/config-provider.tsxdemos/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.tsxdemos/form/config-provider.tsxdemos/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.tsxsrc/utils/components/ProFormContext/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/FieldContext.tsxsrc/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.tsxtests/form/formList.test.tsxsrc/list/Item.tsxsrc/form/components/SchemaForm/typing.tstests/form/upload.test.tsxsrc/utils/conversionMomentValue/index.tssrc/table/typing.tssrc/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.tsxsrc/form/components/TextArea/index.tsxsrc/form/components/FormItem/index.tsxsrc/form/components/Captcha/index.tsxsrc/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.tsxdemos/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.tsxsrc/layout/ProLayout.tsxsrc/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.tsxsrc/form/components/Text/index.tsxsrc/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.tsxsrc/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.tssrc/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.tsxdemos/form/Dependency/dependency2.tsxdemos/form/QueryFilter/light-filter-footer.tsxdemos/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.tsxsrc/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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 -20Repository: 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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 -40Repository: 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 10Repository: 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 antdRepository: 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:
- antd package file listing showing useLazyKVMap exists under table/hooks (internal). [unpkg listing]. [1]
- 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.tsxRepository: 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 -20Repository: 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 5Repository: 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 tsxRepository: 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 -20Repository: 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 -lRepository: 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 存在以下风险:
- antd 版本更新时可能被移除或修改,不提供向后兼容保证
- 在 pro-components 用户升级 antd 时会导致破坏性变更
- 当前没有稳定的公共 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).
…into ant-design-master
There was a problem hiding this 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';.
| import type { TooltipPlacement } from 'antd/es/tooltip'; | ||
| import classNames from 'classnames'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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';.
Modify to ESM import to avoid import error. (e.g. #9344 and #9345)
Reference #9376 .
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.