Overview
ProComponents 3.0 represents a major upgrade focusing on Ant Design 6 support, improved performance, and modernized APIs. This guide will help you migrate from version 2.x to 3.x smoothly.Prerequisites
Version Requirements
Before starting the migration, ensure your dependencies meet these minimum versions:| Dependency | Version 2.x | Version 3.0 Required |
|---|---|---|
| antd | >= 4.20.0 | >= 6.0.0 |
| React | >= 16.9.0 | >= 18.0.0 |
| @ant-design/pro-components | 2.8.10 | >= 3.0.0 |
Breaking Changes
ProTable Changes
columnsStateMap → columnsState
The API for controlling column state has been unified for better consistency.hideInSearch → search: false
Search configuration has been unified under a singlesearch property.
search property also supports advanced configuration:
tip → tooltip
Column tooltips now use the standardtooltip property.
ProCard Changes
Remove ProCard.TabPane
Tab configuration now uses the standard Ant Designitems array.
ProLayout Changes
rightContentRender → actionsRender + avatarProps
The header right content has been split for better maintainability.ProForm Changes
Remove plain Property
Usevariant to control field appearance.
ProList Changes
metas → columns + listSlot
ProList now uses the same column configuration as ProTable.Migration Steps
Update Component by Component
Migrate components in this recommended order:
- ProTable - Update column configurations first
- ProCard - Convert TabPane to items array
- ProForm - Replace plain with variant
- ProLayout - Split rightContentRender
- ProList - Convert metas to columns
Benefits of Upgrading
Improved TypeScript Support
Version 3.0 provides significantly better type inference:Better Performance
- Removed Ant Design 4 compatibility code reduces bundle size
- Improved Tree Shaking for smaller production builds
- Optimized rendering for large datasets
Modernized APIs
More consistent API design following React and Ant Design best practices:- Controlled component patterns
- Standard property naming
- Better composability
Troubleshooting
TypeScript errors after upgrade
TypeScript errors after upgrade
Symptom: Type errors referencing old API propertiesSolution:
- Remove references to
StatisticsCardProps(renamed toStatisticCardProps) - Update custom type definitions that reference old ProComponents types
- Ensure
tsconfig.jsondoesn’t point to old type declarations
Column state not persisting
Column state not persisting
Symptom: Table column configurations reset on page reloadSolution:
- Ensure you’ve added
persistenceKeytocolumnsState - Set
persistenceTypeto'localStorage'or'sessionStorage' - Verify
valueis a new object reference (use spreading or cloning)
Tabs not rendering
Tabs not rendering
Symptom: ProCard tabs show no contentSolution:
- Verify
tabs.itemsarray has properkeyandlabelproperties - Ensure
childrenproperty is set for each tab item - Check that items array isn’t filtered to undefined values
Header actions missing
Header actions missing
Symptom: Layout header right side content disappearedSolution:
- Ensure
actionsRenderreturns an array of ReactNode - Add keys to all rendered action elements
- Check that the function doesn’t return
undefined
Rollback Plan
If you encounter critical issues, you can rollback:Need Help?
If you encounter issues during migration:- Check the GitHub Issues for known problems
- Review the Ant Design 6 migration guide for base component changes
- Join the community discussions for support