Files
react/packages/react-devtools-shared
Ruslan Lesiutin a8b465c6e0 fix[react-devtools]: restore original args when recording errors (#30091)
## Summary

When DevTools frontend and backend are connected, we patch console in 2
places:
- `patch()`, when renderer is attached to:
  - listen to any errors / warnings emitted
  - append component stack if requested by the user
- `patchForStrictMode()`, when React notifies about that the next
invocation is about to happed during StrictMode

`patchForStrictMode()` will always be at the top of the patch stack,
because it is called at runtime when React notifies React DevTools,
because of this, `patch()` may receive already modified arguments (with
stylings for dimming), we should attempt to restore the original
arguments

## How did you test this change?

Look at yellow warnings on the element view:
| Before | After |
| --- | --- |
| ![Screenshot 2024-06-25 at 14 38
26](https://github.com/facebook/react/assets/28902667/6b0ec512-f0c9-4557-a524-d7f31b03464d)
| ![Screenshot 2024-06-25 at 17 26
23](https://github.com/facebook/react/assets/28902667/60ff5d80-06ea-4447-bbe8-b57bc0c63f6d)
|
2024-06-26 14:17:09 +01:00
..
2022-03-16 11:37:10 -04:00

This directory contains code shared between several DevTools packages:

  • /packages/react-devtools-core
  • /packages/react-devtools-extensions
  • /packages/react-devtools-inline

It is not published or released anywhere directly.