From c12d3e0aea252379f0b87497dd2326fffa3aa3f1 Mon Sep 17 00:00:00 2001 From: CHENJIE Date: Thu, 27 Nov 2025 00:38:12 +0800 Subject: [PATCH] docs: fix incorrect ref name in manipulating-the-dom-with-refs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chinese translation mistakenly said "创建了一个名为 MyForm 的 ref", but it should be "创建了一个名为 inputRef 的 ref". --- src/content/learn/manipulating-the-dom-with-refs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/manipulating-the-dom-with-refs.md b/src/content/learn/manipulating-the-dom-with-refs.md index ffaec1a502..7f0c992857 100644 --- a/src/content/learn/manipulating-the-dom-with-refs.md +++ b/src/content/learn/manipulating-the-dom-with-refs.md @@ -375,7 +375,7 @@ function MyForm() { } ``` -在上面这个例子中,父组件创建了一个名为 `MyForm` 的 ref,并且将它传递给了 `MyInput` 子组件。`MyInput` 将这个 ref 传递给 ``。因为 `` 是一个 [内置组件](/reference/react-dom/components/common),React 会将 ref 的 `.current` 属性设置为这个 `` DOM 元素。 +在上面这个例子中,父组件 `MyForm` 创建了一个名为 `inputRef` 的 ref,并且将它传递给了 `MyInput` 子组件。`MyInput` 将这个 ref 传递给 ``。因为 `` 是一个 [内置组件](/reference/react-dom/components/common),React 会将 ref 的 `.current` 属性设置为这个 `` DOM 元素。 在 `MyForm` 中创建的 `inputRef` 现在指向 `MyInput` 返回的 `` DOM 元素。在 `MyForm` 中创建的点击处理程序可以访问 `inputRef` 并且调用 `focus()` 来将焦点设置在 `` 上。