Skip to content

Commit 3c805e7

Browse files
fix(reference): missing parameter in hydrateRoot (#7724)
1 parent 5598696 commit 3c805e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,13 @@ It is uncommon to call [`root.render`](#root-render) on a hydrated root. Usually
378378
379379
By default, React will log all errors to the console. To implement your own error reporting, you can provide the optional error handler root options `onUncaughtError`, `onCaughtError` and `onRecoverableError`:
380380
381-
```js [[1, 6, "onCaughtError"], [2, 6, "error", 1], [3, 6, "errorInfo"], [4, 10, "componentStack", 15]]
381+
```js [[1, 7, "onCaughtError"], [2, 7, "error", 1], [3, 7, "errorInfo"], [4, 11, "componentStack", 15]]
382382
import { hydrateRoot } from "react-dom/client";
383+
import App from "./App.js";
383384
import { reportCaughtError } from "./reportError";
384385

385386
const container = document.getElementById("root");
386-
const root = hydrateRoot(container, {
387+
const root = hydrateRoot(container, <App />, {
387388
onCaughtError: (error, errorInfo) => {
388389
if (error.message !== "Known error") {
389390
reportCaughtError({

0 commit comments

Comments
 (0)