You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/client/createRoot.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -349,7 +349,7 @@ It is uncommon to call `render` multiple times. Usually, your components will [u
349
349
By default, React will log all uncaught errors to the console. To implement your own error reporting, you can provide the optional `onUncaughtError` root option:
// captureOwnerStack is only available in react@experimental.
352
+
// captureOwnerStack is only available in react@canary.
353
353
import { captureOwnerStack } from'react';
354
354
import { createRoot } from'react-dom/client';
355
355
@@ -374,7 +374,7 @@ The <CodeStep step={1}>onUncaughtError</CodeStep> option is a function called wi
374
374
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
375
375
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
376
376
377
-
<ExperimentalBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
377
+
<CanaryBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
378
378
379
379
You can use the `onUncaughtError` root option to display error dialogs:
380
380
@@ -543,7 +543,7 @@ export function reportRecoverableError({error, cause, componentStack, ownerStack
543
543
```
544
544
545
545
```js src/index.js active
546
-
// captureOwnerStack is only available in react@experimental.
546
+
// captureOwnerStack is only available in react@canary.
547
547
import { captureOwnerStack } from'react';
548
548
import { createRoot } from"react-dom/client";
549
549
importAppfrom"./App.js";
@@ -613,7 +613,7 @@ export default function App() {
613
613
By default, React will log all errors caught by an Error Boundary to `console.error`. To override this behavior, you can provide the optional `onCaughtError` root option to handle errors caught by an [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary):
// captureOwnerStack is only available in react@experimental.
616
+
// captureOwnerStack is only available in react@canary.
617
617
import { captureOwnerStack } from'react';
618
618
import { createRoot } from'react-dom/client';
619
619
@@ -638,7 +638,7 @@ The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with
638
638
1. The <CodeStep step={2}>error</CodeStep> that was caught by the boundary.
639
639
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
640
640
641
-
<ExperimentalBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
641
+
<CanaryBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
642
642
643
643
You can use the `onCaughtError` root option to display error dialogs or filter known errors from logging:
644
644
@@ -807,7 +807,7 @@ export function reportRecoverableError({error, cause, componentStack, ownerStack
807
807
```
808
808
809
809
```js src/index.js active
810
-
// captureOwnerStack is only available in react@experimental.
810
+
// captureOwnerStack is only available in react@canary.
811
811
import {captureOwnerStack} from'react';
812
812
import { createRoot } from"react-dom/client";
813
813
importAppfrom"./App.js";
@@ -904,7 +904,7 @@ function Throw({error}) {
904
904
React may automatically render a component a second time to attempt to recover from an error thrown in render. If successful, React will log a recoverable error to the console to notify the developer. To override this behavior, you can provide the optional `onRecoverableError` root option:
// captureOwnerStack is only available in react@experimental.
907
+
// captureOwnerStack is only available in react@canary.
908
908
import { captureOwnerStack } from'react';
909
909
import { createRoot } from'react-dom/client';
910
910
@@ -930,7 +930,7 @@ The <CodeStep step={1}>onRecoverableError</CodeStep> option is a function called
930
930
1. The <CodeStep step={2}>error</CodeStep> that React throws. Some errors may include the original cause as <CodeStep step={3}>error.cause</CodeStep>.
931
931
2. An <CodeStep step={4}>errorInfo</CodeStep> object that contains the <CodeStep step={5}>componentStack</CodeStep> of the error.
932
932
933
-
<ExperimentalBadge /> With <CodeStep step={6}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
933
+
<CanaryBadge /> With <CodeStep step={6}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
934
934
935
935
You can use the `onRecoverableError` root option to display error dialogs:
936
936
@@ -1099,7 +1099,7 @@ export function reportRecoverableError({error, cause, componentStack, ownerStack
1099
1099
```
1100
1100
1101
1101
```js src/index.js active
1102
-
// captureOwnerStack is only available in react@experimental.
1102
+
// captureOwnerStack is only available in react@canary.
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/client/hydrateRoot.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,7 +379,7 @@ It is uncommon to call [`root.render`](#root-render) on a hydrated root. Usually
379
379
By default, React will log all uncaught errors to the console. To implement your own error reporting, you can provide the optional `onUncaughtError` root option:
// captureOwnerStack is only available in react@experimental.
382
+
// captureOwnerStack is only available in react@canary.
383
383
import { captureOwnerStack } from'react';
384
384
import { hydrateRoot } from'react-dom/client';
385
385
@@ -404,7 +404,7 @@ The <CodeStep step={1}>onUncaughtError</CodeStep> option is a function called wi
404
404
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
405
405
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
406
406
407
-
<ExperimentalBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
407
+
<CanaryBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
408
408
409
409
You can use the `onUncaughtError` root option to display error dialogs:
410
410
@@ -576,7 +576,7 @@ export function reportRecoverableError({error, cause, componentStack, ownerStack
576
576
```
577
577
578
578
```js src/index.js active
579
-
// captureOwnerStack is only available in react@experimental.
579
+
// captureOwnerStack is only available in react@canary.
580
580
import { captureOwnerStack } from'react';
581
581
import { hydrateRoot } from"react-dom/client";
582
582
importAppfrom"./App.js";
@@ -646,7 +646,7 @@ export default function App() {
646
646
By default, React will log all errors caught by an Error Boundary to `console.error`. To override this behavior, you can provide the optional `onCaughtError` root option for errors caught by an [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary):
// captureOwnerStack is only available in react@experimental.
649
+
// captureOwnerStack is only available in react@canary.
650
650
import { captureOwnerStack } from'react';
651
651
import { hydrateRoot } from'react-dom/client';
652
652
@@ -671,7 +671,7 @@ The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with
671
671
1. The <CodeStep step={2}>error</CodeStep> that was caught by the boundary.
672
672
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
673
673
674
-
<ExperimentalBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
674
+
<CanaryBadge /> With <CodeStep step={5}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
675
675
676
676
You can use the `onCaughtError` root option to display error dialogs or filter known errors from logging:
677
677
@@ -843,7 +843,7 @@ export function reportRecoverableError({error, cause, componentStack}) {
843
843
```
844
844
845
845
```js src/index.js active
846
-
// captureOwnerStack is only available in react@experimental.
846
+
// captureOwnerStack is only available in react@canary.
847
847
import {captureOwnerStack} from'react';
848
848
import { hydrateRoot } from"react-dom/client";
849
849
importAppfrom"./App.js";
@@ -939,7 +939,7 @@ function Throw({error}) {
939
939
When React encounters a hydration mismatch, it will automatically attempt to recover by rendering on the client. By default, React will log hydration mismatch errors to `console.error`. To override this behavior, you can provide the optional `onRecoverableError` root option:
// captureOwnerStack is only available in react@experimental.
942
+
// captureOwnerStack is only available in react@canary.
943
943
import { captureOwnerStack } from'react';
944
944
import { hydrateRoot } from'react-dom/client';
945
945
@@ -965,7 +965,7 @@ The <CodeStep step={1}>onRecoverableError</CodeStep> option is a function called
965
965
1. The <CodeStep step={2}>error</CodeStep> React throws. Some errors may include the original cause as <CodeStep step={3}>error.cause</CodeStep>.
966
966
2. An <CodeStep step={4}>errorInfo</CodeStep> object that contains the <CodeStep step={5}>componentStack</CodeStep> of the error.
967
967
968
-
<ExperimentalBadge /> With <CodeStep step={6}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
968
+
<CanaryBadge /> With <CodeStep step={6}>[`captureOwnerStack`](/reference/react/captureOwnerStack)</CodeStep> you can include the Owner Stack during development.
969
969
970
970
You can use the `onRecoverableError` root option to display error dialogs for hydration mismatches:
971
971
@@ -1137,7 +1137,7 @@ export function reportRecoverableError({error, cause, componentStack, ownerStack
1137
1137
```
1138
1138
1139
1139
```js src/index.js active
1140
-
// captureOwnerStack is only available in react@experimental.
1140
+
// captureOwnerStack is only available in react@canary.
Copy file name to clipboardExpand all lines: src/content/reference/react/Component.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1273,7 +1273,7 @@ By default, if your application throws an error during rendering, React will rem
1273
1273
1274
1274
To implement an error boundary component, you need to provide [`static getDerivedStateFromError`](#static-getderivedstatefromerror) which lets you update state in response to an error and display an error message to the user. You can also optionally implement [`componentDidCatch`](#componentdidcatch) to add some extra logic, for example, to log the error to an analytics service.
1275
1275
1276
-
<ExperimentalBadge /> With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
1276
+
<CanaryBadge /> With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
1277
1277
1278
1278
```js {9-12,14-27}
1279
1279
import*asReactfrom'react';
@@ -1298,7 +1298,7 @@ class ErrorBoundary extends React.Component {
1298
1298
// in div (created by App)
1299
1299
// in App
1300
1300
info.componentStack,
1301
-
// Only available in react@experimental.
1301
+
// Only available in react@canary.
1302
1302
// Warning: Owner Stack is not available in production.
Copy file name to clipboardExpand all lines: src/content/reference/react/captureOwnerStack.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,11 @@
2
2
title: captureOwnerStack
3
3
---
4
4
5
-
<Wip>
5
+
<Canary>
6
6
7
-
**This API is experimental and is not available in a stable version of React yet.**
7
+
The `captureOwnerStack`API is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8
8
9
-
You can try it by upgrading React packages to the most recent experimental version:
10
-
11
-
-`react@experimental`
12
-
13
-
Experimental versions of React may contain bugs. Don't use them in production.
0 commit comments