docs(hydrateRoot): update suppressHydrationWarning behavior (#7651)

This commit is contained in:
Sam Ko
2025-02-26 12:08:17 -08:00
committed by GitHub
parent fc29603434
commit 4a4e579fdb

View File

@@ -99,7 +99,7 @@ An app fully built with React will usually not have any calls to `root.unmount`.
This is mostly useful if your React root's DOM node (or any of its ancestors) may get removed from the DOM by some other code. For example, imagine a jQuery tab panel that removes inactive tabs from the DOM. If a tab gets removed, everything inside it (including the React roots inside) would get removed from the DOM as well. You need to tell React to "stop" managing the removed root's content by calling `root.unmount`. Otherwise, the components inside the removed root won't clean up and free up resources like subscriptions.
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.
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.
#### Parameters {/*root-unmount-parameters*/}
@@ -270,7 +270,7 @@ export default function App() {
</Sandpack>
This only works one level deep, and is intended to be an escape hatch. Dont overuse it. Unless its text content, React still wont attempt to patch it up, so it may remain inconsistent until future updates.
This only works one level deep, and is intended to be an escape hatch. Dont overuse it. React will **not** attempt to patch mismatched text content.
---