Skip to content

Commit 4a08a62

Browse files
committed
Differentiate parent and owner stacks throughout docs
1 parent 8e82a43 commit 4a08a62

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ An app fully built with React will usually only have one `createRoot` call for i
4545
4646
* **optional** `options`: An object with options for this React root.
4747
48-
* **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the `componentStack`.
49-
* **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown, and an `errorInfo` object containing the `componentStack`.
50-
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors. Called with an `error` React throws, and an `errorInfo` object containing the `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
48+
* **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the parent Component stack in `componentStack`.
49+
* **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown, and an `errorInfo` object containing the parent Component stack in `componentStack`.
50+
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors. Called with an `error` React throws, and an `errorInfo` object containing the parent Component stack in `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
5151
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/reference/react/useId) Useful to avoid conflicts when using multiple roots on the same page.
5252
5353
#### Returns {/*returns*/}
@@ -369,7 +369,7 @@ root.render(<App />);
369369
The <CodeStep step={1}>onUncaughtError</CodeStep> option is a function called with two arguments:
370370
371371
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
372-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
372+
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the parent Component stack in <CodeStep step={4}>componentStack</CodeStep> of the error.
373373
374374
You can use the `onUncaughtError` root option to display error dialogs:
375375
@@ -600,7 +600,7 @@ root.render(<App />);
600600
The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with two arguments:
601601
602602
1. The <CodeStep step={2}>error</CodeStep> that was caught by the boundary.
603-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
603+
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the parent Component stack in <CodeStep step={4}>componentStack</CodeStep> of the error.
604604
605605
You can use the `onCaughtError` root option to display error dialogs or filter known errors from logging:
606606

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ React will attach to the HTML that exists inside the `domNode`, and take over ma
4141
4242
* **optional** `options`: An object with options for this React root.
4343
44-
* **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the `componentStack`.
45-
* **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown and an `errorInfo` object containing the `componentStack`.
46-
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors. Called with the `error` React throws, and an `errorInfo` object containing the `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
44+
* **optional** `onCaughtError`: Callback called when React catches an error in an Error Boundary. Called with the `error` caught by the Error Boundary, and an `errorInfo` object containing the parent Component stack in `componentStack`.
45+
* **optional** `onUncaughtError`: Callback called when an error is thrown and not caught by an Error Boundary. Called with the `error` that was thrown and an `errorInfo` object containing the parent Component stack in `componentStack`.
46+
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors. Called with the `error` React throws, and an `errorInfo` object containing the parent Component stack in `componentStack`. Some recoverable errors may include the original error cause as `error.cause`.
4747
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/reference/react/useId) Useful to avoid conflicts when using multiple roots on the same page. Must be the same prefix as used on the server.
4848
4949
@@ -400,7 +400,7 @@ root.render(<App />);
400400
The <CodeStep step={1}>onUncaughtError</CodeStep> option is a function called with two arguments:
401401
402402
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
403-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
403+
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the parent Component stack in <CodeStep step={4}>componentStack</CodeStep> of the error.
404404
405405
You can use the `onUncaughtError` root option to display error dialogs:
406406
@@ -635,7 +635,7 @@ root.render(<App />);
635635
The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with two arguments:
636636
637637
1. The <CodeStep step={2}>error</CodeStep> that was caught by the boundary.
638-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
638+
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the parent Component stack in <CodeStep step={4}>componentStack</CodeStep> of the error.
639639
640640
You can use the `onCaughtError` root option to display error dialogs or filter known errors from logging:
641641
@@ -916,7 +916,7 @@ const root = hydrateRoot(
916916
The <CodeStep step={1}>onRecoverableError</CodeStep> option is a function called with two arguments:
917917
918918
1. The <CodeStep step={2}>error</CodeStep> React throws. Some errors may include the original cause as <CodeStep step={3}>error.cause</CodeStep>.
919-
2. An <CodeStep step={4}>errorInfo</CodeStep> object that contains the <CodeStep step={5}>componentStack</CodeStep> of the error.
919+
2. An <CodeStep step={4}>errorInfo</CodeStep> object that contains the parent Component stack in <CodeStep step={5}>componentStack</CodeStep> of the error.
920920
921921
You can use the `onRecoverableError` root option to display error dialogs for hydration mismatches:
922922

0 commit comments

Comments
 (0)