|
2 | 2 | title: captureOwnerStack |
3 | 3 | --- |
4 | 4 |
|
5 | | -<Canary> |
6 | | - |
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 | | - |
9 | | -</Canary> |
10 | | - |
11 | 5 | <Intro> |
12 | 6 |
|
13 | 7 | `captureOwnerStack` reads the current Owner Stack in development and returns it as a string if available. |
@@ -126,22 +120,6 @@ createRoot(document.createElement('div'), { |
126 | 120 | ); |
127 | 121 | ``` |
128 | 122 |
|
129 | | -```json package.json hidden |
130 | | -{ |
131 | | - "dependencies": { |
132 | | - "react": "canary", |
133 | | - "react-dom": "canary", |
134 | | - "react-scripts": "latest" |
135 | | - }, |
136 | | - "scripts": { |
137 | | - "start": "react-scripts start", |
138 | | - "build": "react-scripts build", |
139 | | - "test": "react-scripts test --env=jsdom", |
140 | | - "eject": "react-scripts eject" |
141 | | - } |
142 | | -} |
143 | | -``` |
144 | | - |
145 | 123 | ```html public/index.html hidden |
146 | 124 | <!DOCTYPE html> |
147 | 125 | <html lang="en"> |
@@ -357,22 +335,6 @@ const container = document.getElementById("root"); |
357 | 335 | createRoot(container).render(<App />); |
358 | 336 | ``` |
359 | 337 |
|
360 | | -```json package.json hidden |
361 | | -{ |
362 | | - "dependencies": { |
363 | | - "react": "canary", |
364 | | - "react-dom": "canary", |
365 | | - "react-scripts": "latest" |
366 | | - }, |
367 | | - "scripts": { |
368 | | - "start": "react-scripts start", |
369 | | - "build": "react-scripts build", |
370 | | - "test": "react-scripts test --env=jsdom", |
371 | | - "eject": "react-scripts eject" |
372 | | - } |
373 | | -} |
374 | | -``` |
375 | | - |
376 | 338 | ```js src/App.js |
377 | 339 | function Component() { |
378 | 340 | return <button onClick={() => console.error('Some console error')}>Trigger console.error()</button>; |
@@ -417,22 +379,6 @@ export default function App() { |
417 | 379 | } |
418 | 380 | ``` |
419 | 381 |
|
420 | | -```json package.json hidden |
421 | | -{ |
422 | | - "dependencies": { |
423 | | - "react": "canary", |
424 | | - "react-dom": "canary", |
425 | | - "react-scripts": "latest" |
426 | | - }, |
427 | | - "scripts": { |
428 | | - "start": "react-scripts start", |
429 | | - "build": "react-scripts build", |
430 | | - "test": "react-scripts test --env=jsdom", |
431 | | - "eject": "react-scripts eject" |
432 | | - } |
433 | | -} |
434 | | -``` |
435 | | - |
436 | 382 | </Sandpack> |
437 | 383 |
|
438 | 384 | ### `captureOwnerStack` is not available {/*captureownerstack-is-not-available*/} |
|
0 commit comments