Skip to content

Commit b77c05d

Browse files
authored
Misc captureOwnerStack cleanup after stable release (#7710)
1. Stop using `canary` for `captureOwnerStack` sandboxes 1. Remove remaining Canary badges from `captureOwnerStack` mentions
1 parent 6a548a8 commit b77c05d

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

src/content/reference/react/Component.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ By default, if your application throws an error during rendering, React will rem
12731273
12741274
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.
12751275
1276-
<CanaryBadge /> With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
1276+
With [`captureOwnerStack`](/reference/react/captureOwnerStack) you can include the Owner Stack during development.
12771277
12781278
```js {9-12,14-27}
12791279
import * as React from 'react';
@@ -1298,8 +1298,7 @@ class ErrorBoundary extends React.Component {
12981298
// in div (created by App)
12991299
// in App
13001300
info.componentStack,
1301-
// Only available in react@canary.
1302-
// Warning: Owner Stack is not available in production.
1301+
// Warning: `captureOwnerStack` is not available in production.
13031302
React.captureOwnerStack(),
13041303
);
13051304
}

src/content/reference/react/captureOwnerStack.md

-48
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,6 @@ createRoot(document.createElement('div'), {
120120
);
121121
```
122122

123-
```json package.json hidden
124-
{
125-
"dependencies": {
126-
"react": "canary",
127-
"react-dom": "canary",
128-
"react-scripts": "latest"
129-
},
130-
"scripts": {
131-
"start": "react-scripts start",
132-
"build": "react-scripts build",
133-
"test": "react-scripts test --env=jsdom",
134-
"eject": "react-scripts eject"
135-
}
136-
}
137-
```
138-
139123
```html public/index.html hidden
140124
<!DOCTYPE html>
141125
<html lang="en">
@@ -351,22 +335,6 @@ const container = document.getElementById("root");
351335
createRoot(container).render(<App />);
352336
```
353337

354-
```json package.json hidden
355-
{
356-
"dependencies": {
357-
"react": "canary",
358-
"react-dom": "canary",
359-
"react-scripts": "latest"
360-
},
361-
"scripts": {
362-
"start": "react-scripts start",
363-
"build": "react-scripts build",
364-
"test": "react-scripts test --env=jsdom",
365-
"eject": "react-scripts eject"
366-
}
367-
}
368-
```
369-
370338
```js src/App.js
371339
function Component() {
372340
return <button onClick={() => console.error('Some console error')}>Trigger console.error()</button>;
@@ -411,22 +379,6 @@ export default function App() {
411379
}
412380
```
413381

414-
```json package.json hidden
415-
{
416-
"dependencies": {
417-
"react": "canary",
418-
"react-dom": "canary",
419-
"react-scripts": "latest"
420-
},
421-
"scripts": {
422-
"start": "react-scripts start",
423-
"build": "react-scripts build",
424-
"test": "react-scripts test --env=jsdom",
425-
"eject": "react-scripts eject"
426-
}
427-
}
428-
```
429-
430382
</Sandpack>
431383

432384
### `captureOwnerStack` is not available {/*captureownerstack-is-not-available*/}

0 commit comments

Comments
 (0)