Ant Design v6 Brings CSS Variables and Zero-Runtime Mode With Key Migration Caveats
Ant Design v6 is a performance-focused release that adopts CSS variables by default, introduces a zeroRuntime styling mode, and drops support for React 17 and below. The upgrade requires developers to simultaneously update the @ant-design/icons package to v6, as the new icons version is incompatible with antd v5. A notable migration pitfall involves ConfigProvider: if the theme value is briefly undefined during rendering, components can unexpectedly remount, which teams can prevent by defaulting undefined tokens to an empty object. The new zeroRuntime mode eliminates runtime style generation, improving startup speed and reducing JavaScript work, but requires developers to manually import or statically extract component CSS at build time. Internal DOM structure changes in v6 also mean that any custom CSS targeting Ant Design's internal class names or element selectors must be audited and rewritten.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in