Skip to content

Commit b5b9297

Browse files
committed
docs(en): merging all conflicts
2 parents 8d7c60e + 4a4e579 commit b5b9297

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/content/reference/react-dom/client/hydrateRoot.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ root.unmount();
101101
102102
这主要适用于 React 根节点的 DOM 节点(或其任何祖先节点)可能会被其他代码从 DOM 中移除的情况。例如,想象一下一个 jQuery 标签面板,它会将非活动标签从 DOM 中移除。如果一个标签被移除,其内部的所有内容(包括其中的 React 根节点)也将从 DOM 中移除。你需要调用 `root.unmount` 来告诉 React “停止”管理已移除根节点的内容。否则,已移除根节点内的组件将无法清理和释放已使用的资源,例如订阅。
103103
104+
<<<<<<< HEAD
104105
调用 `root.unmount` 将卸载根节点中的所有组件,并“分离” React 与根 DOM 节点之间的连接,包括删除树中的任何事件处理程序或状态。
106+
=======
107+
Calling `root.unmount` will unmount all the components in the root and "detach" React from the root DOM node, including removing any event handlers or state in the tree.
108+
>>>>>>> 4a4e579fdb4fd4b97bc4b983487c2e83291211fd
105109
106110
107111
#### 参数 {/*root-unmount-parameters*/}
@@ -272,7 +276,11 @@ export default function App() {
272276
273277
</Sandpack>
274278
279+
<<<<<<< HEAD
275280
此方法仅适用于当前层级,并且旨在作为一种脱围机制。不要滥用它。除非是文本内容,否则 React 不会尝试修补它,因此可能会保持不一致,直到未来的更新来到。
281+
=======
282+
This only works one level deep, and is intended to be an escape hatch. Don’t overuse it. React will **not** attempt to patch mismatched text content.
283+
>>>>>>> 4a4e579fdb4fd4b97bc4b983487c2e83291211fd
276284
277285
---
278286

0 commit comments

Comments
 (0)