From 6b622e4afb9178029ea807ad1bc19cdfdb1d8404 Mon Sep 17 00:00:00 2001 From: jiaxiang Date: Tue, 12 Nov 2024 09:17:11 +0800 Subject: [PATCH] docs: update note about controlled-components (#51579) --- docs/react/faq.en-US.md | 4 ++-- docs/react/faq.zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index 46a718bc9d..3ad572ff05 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -69,7 +69,7 @@ Please refer to [Use custom date library](/docs/react/use-custom-date-library). ## It doesn't work when I change `defaultValue` dynamically. -The `defaultXxxx` (e.g. `defaultValue`) of `Input`/`Select`(etc...) only works on the first render. It is a specification of React. Please read [React's documentation](https://facebook.github.io/react/docs/forms.html#controlled-components). +The `defaultXxxx` (e.g. `defaultValue`) of `Input`/`Select`(etc...) only works on the first render. It is a specification of React. Please read [React's documentation](https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable). ## Why does modifying props in mutable way not trigger a component update? @@ -77,7 +77,7 @@ antd use shallow compare of props to optimize performance. You should always pas ## After I set the `value` of an `Input`/`Select`(etc.) component, the value cannot be changed by user's action. -Try `onChange` to change `value`, and please read [React's documentation](https://reactjs.org/docs/forms.html#controlled-components). +Try `onChange` to change `value`, and please read [React's documentation](https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable). ## Components are not vertically aligned when placed in single row. diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index 705904aefb..dcfea489b9 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -69,7 +69,7 @@ antd 在 minor 和 patch 版本迭代中会避免引入破坏性变更,遵从 ## 当我动态改变 `defaultValue` 的时候它并没有生效。 -`Input`/`Select` 等的 `defaultXxxx`(例如 `defaultValue`)只有在第一次渲染的时候有效,这是 React 的规范,请阅读 [React 的文档](https://zh-hans.reactjs.org/docs/forms.html#controlled-components)。 +`Input`/`Select` 等的 `defaultXxxx`(例如 `defaultValue`)只有在第一次渲染的时候有效,这是 React 的规范,请阅读 [React 的文档](https://zh-hans.react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable)。 ## 为什么修改组件传入的对象或数组属性组件不会更新? @@ -77,7 +77,7 @@ antd 内部会对 props 进行浅比较实现性能优化。当状态变更, ## 当我设置了 `Input`/`Select` 等的 `value` 时它就无法修改了。 -尝试使用 `onChange` 来改变 `value`,请参考 [React 的文档](https://zh-hans.reactjs.org/docs/forms.html#controlled-components)。 +尝试使用 `onChange` 来改变 `value`,请参考 [React 的文档](https://zh-hans.react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable)。 ## 多个组件放一排时没有垂直对齐怎么办?