Skip to content

Commit 66562e8

Browse files
committed
Ensure comments don't hscroll
1 parent 9806ea7 commit 66562e8

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/content/reference/react/captureOwnerStack.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ import './styles.css';
105105

106106
createRoot(document.createElement('div'), {
107107
onUncaughtError: (error, errorInfo) => {
108-
// The stacks are logged instead of showing them in the UI directly to highlight that browsers will apply sourcemaps to the logged stacks.
109-
// Note that sourcemapping is only applied in the real browser console not in the fake one displayed on this page.
108+
// The stacks are logged instead of showing them in the UI directly to
109+
// highlight that browsers will apply sourcemaps to the logged stacks.
110+
// Note that sourcemapping is only applied in the real browser console not
111+
// in the fake one displayed on this page.
110112
console.log(errorInfo.componentStack);
111113
console.log(captureOwnerStack());
112114
},
@@ -235,14 +237,18 @@ const root = createRoot(document.getElementById('root'), {
235237
if (process.env.NODE_ENV !== 'production') {
236238
const ownerStack = captureOwnerStack();
237239
error.stack =
238-
// The stack is only split because these sandboxes don't implement ignore-listing 3rd party frames via sourcemaps.
239-
// A framework would ignore-list stackframes from React via sourcemaps and then you could just `error.stack += ownerStack`.
240+
// The stack is only split because these sandboxes don't implement
241+
// ignore-listing 3rd party frames via sourcemaps.
242+
// A framework would ignore-list stackframes from React via sourcemaps
243+
// and then you could just `error.stack += ownerStack`.
240244
// To learn more about ignore-listing see https://developer.chrome.com/docs/devtools/x-google-ignore-list
241245
error.stack.split('\n at react-stack-bottom-frame')[0] + ownerStack;
242246
}
243247

244-
// The stacks are logged instead of showing them in the UI directly to highlight that browsers will apply sourcemaps to the logged stacks.
245-
// Note that sourcemapping is only applied in the real browser console not in the fake one displayed on this page.
248+
// The stacks are logged instead of showing them in the UI directly to
249+
// highlight that browsers will apply sourcemaps to the logged stacks.
250+
// Note that sourcemapping is only applied in the real browser console not
251+
// in the fake one displayed on this page.
246252
console.error('Uncaught', error);
247253
},
248254
}).render(<App />);

0 commit comments

Comments
 (0)