diff --git a/src/content/reference/react-dom/components/textarea.md b/src/content/reference/react-dom/components/textarea.md index 388bcf2632..88850af21d 100644 --- a/src/content/reference/react-dom/components/textarea.md +++ b/src/content/reference/react-dom/components/textarea.md @@ -4,7 +4,7 @@ title: "` is not allowed. [Use `defaultValue` for initial content.](#providing-an-initial-value-for-a-text-area) -- If a text area receives a string `value` prop, it will be [treated as controlled.](#controlling-a-text-area-with-a-state-variable) -- A text area can't be both controlled and uncontrolled at the same time. -- A text area cannot switch between being controlled or uncontrolled over its lifetime. -- Every controlled text area needs an `onChange` event handler that synchronously updates its backing value. +- 不允许传递像 `` 这样的子元素,你应该 [使用 `defaultValue` 提供初始值](#providing-an-initial-value-for-a-text-area)。 +- 如果一个文本框接收字符串类型的 `value` 属性,那么它将被视为 [受控组件](#controlling-a-text-area-with-a-state-variable)。 +- 一个文本框不能同时既是受控组件又是非受控组件。 +- 一个文本框在其生命周期内无法在受控和非受控之间切换。 +- 每个受控文本框都需要一个 `onChange` 事件处理程序,以同步更新其后面的新值。 --- -## Usage {/*usage*/} +## 用法 {/*usage*/} -### Displaying a text area {/*displaying-a-text-area*/} +### 展示一个文本框 {/*displaying-a-text-area*/} -Render `` is not supported. +与 HTML 不同,像这样传递初始值 `` 将不受支持。 --- -### Reading the text area value when submitting a form {/*reading-the-text-area-value-when-submitting-a-form*/} +### 提交表单时读取文本框的值 {/*reading-the-text-area-value-when-submitting-a-form*/} -Add a [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) around your textarea with a [`