This document will help you upgrade antd from version 5.x to 6.x. This release is primarily a technical upgrade, most component APIs remain compatible, you will need to ensure your environment meets the new requirements before upgrading.
Install:
npm install --save antd@6# oryarn add antd@6# orpnpm add antd@6
antd@6 requires React >= 18 and no longer supports React 17 or earlier.@ant-design/v5-patch-for-react-19 package to support React 19; you can remove it if present.- import '@ant-design/v5-patch-for-react-19';
mask overlay option and supports a blur effect.import { ConfigProvider, Drawer, Modal } from 'antd';export default () => (<ConfigProvidermodal={{mask: {blur: false,},}}drawer={{mask: {blur: false,},}}><Modal /><Drawer /></ConfigProvider>);
v6 removes the trailing default margin from the Tag component (previously a horizontal list of Tags left an extra margin-inline-end on the last one). If your layout or custom styles relied on that implicit spacing, reintroduce it via ConfigProvider tag.styles:
import { ConfigProvider, Tag } from 'antd';export default () => (<ConfigProvidertag={{styles: {root: {marginInlineEnd: 8,},},}}><Tag>Tag A</Tag><Tag>Tag B</Tag><Tag>Tag C</Tag></ConfigProvider>);
If you only need the old spacing in specific areas, prefer local container overrides instead of global configuration to avoid unintended impact elsewhere.
onFinish no longer includes all data from Form.ListIn v5, Form.List was treated as a single Field, causing onFinish to include all data within the Form.List structure, even for items without a registered Form.Item. In v6, Form.List no longer includes data from unregistered child items. Therefore, you no longer need to use getFieldsValue({ strict: true }) to filter out unregistered fields.
const onFinish = (values) => {-- const realValues = getFieldsValue({ strict: true });++ const realValues = values;// ...}<Form onFinish={onFinish} />
To ensure your app works correctly after upgrading to v6, please go through the following checklist:
@ant-design/v5-patch-for-react-19.If you run into problems while upgrading, please open an issue at https://new-issue.ant.design/. We'll respond as soon as possible and improve the documentation.