From 8065093543ce404106edd8a4889d88b44edd6e64 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 6 Sep 2025 14:12:48 +0800 Subject: [PATCH] docs: improve react 19 compatibility info (#54898) * docs: improve react 19 compatibility info Signed-off-by: afc163 * Update v5-for-19.en-US.md Signed-off-by: afc163 --------- Signed-off-by: afc163 Co-authored-by: thinkasany <480968828@qq.com> --- docs/react/v5-for-19.en-US.md | 10 +++++----- docs/react/v5-for-19.zh-CN.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/react/v5-for-19.en-US.md b/docs/react/v5-for-19.en-US.md index 528243607c..c874b1d1fc 100644 --- a/docs/react/v5-for-19.en-US.md +++ b/docs/react/v5-for-19.en-US.md @@ -6,15 +6,15 @@ tag: New :::info{title="Compatibility Interface"} -antd v5 compatibility with React 16 ~ 18 by default. For React 19, you can use the following compatibility methods to adapt. -::: +antd v5 is compatible with React 16 ~ 18 by default, and most features are also compatible with React 19. A few issues are listed below, and the following compatibility methods can be used for adaptation. This method and interface will be removed in v6. +:::: ### React 19 Compatibility Issues -Since React 19 adjusted the export method of `react-dom`, antd cannot directly use the `ReactDOM.render` method. Therefore, using antd will encounter the following problems: +Due to React 19 adjusting the export method of `react-dom`, antd cannot directly use the `ReactDOM.render` method. Therefore, using antd will encounter the following issues: -- Wave effect does not show -- Static methods of `Modal`, `Notification`, `Message` not working +- Wave effect does not work properly +- `Modal`、`Notification`、`Message` and other components' static methods are invalid (hooks invocation methods are not affected). Therefore, you need to use a compatibility configuration to make antd work properly in React 19. diff --git a/docs/react/v5-for-19.zh-CN.md b/docs/react/v5-for-19.zh-CN.md index 396de75197..7615cbb4e2 100644 --- a/docs/react/v5-for-19.zh-CN.md +++ b/docs/react/v5-for-19.zh-CN.md @@ -6,7 +6,7 @@ tag: New :::info{title="兼容接口"} -antd v5 默认兼容 React 16 ~ 18 版本,对于 React 19 版本,可以使用以下兼容方法进行适配。该兼容方式以及接口将在 v6 被移除。 +antd v5 默认兼容 React 16 ~ 18 版本,绝大多数功能也兼容于 React 19 版本。少数问题如下所示,可使用以下兼容方法进行适配。该方式以及接口将在 v6 被移除。 ::: ### React 19 兼容问题 @@ -14,7 +14,7 @@ antd v5 默认兼容 React 16 ~ 18 版本,对于 React 19 版本,可以使 由于 React 19 调整了 `react-dom` 的导出方式,导致 antd 无法直接使用 `ReactDOM.render` 方法。因而使用 antd 会遇到以下问题: - 波纹特效无法正常工作 -- `Modal`、`Notification`、`Message` 等组件的静态方法无效 +- `Modal`、`Notification`、`Message` 等组件的静态方法无效(hooks 调用方式不受影响) 因而需要通过兼容配置,使 antd 在 React 19 中正常工作。