[react-dom] Provide a way to silence devtools recommendation
If you hit this console message and search for how to turn it off, many people recommend hacky ways to do so that also end up breaking the extension if you actually want to use it later on.
This provides a way to turn off just the message, without trying to trick injectIntoDevTools into thinking something's happened.
This SO answer is a good example of a "wrong answer" to disabling this logging warning:
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = { isDisabled: true };
This disables the integration entirely instead of simply removing the warning if it's not installed. A project might want to simply not have the log show up for its own reasons.
I'm sending this up, if it's OK in principle the best thing would be to include 2 lines in some docs so that it can be the first result of a web search for people looking to disable it.
As to why I want to disable this: I run some tests without minified react. In the CI environment I do not need the devtools installed. I would like to avoid having to write some special-cased code to hack-away a removal of this message.
related issues: #12041
Hi @rtpg!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Comparing: c4083616a232028588a2cbaa9ba8992481d1deb7...6797b3666f30b09e3964eac152e36bb377ef8c83
Critical size changes
Includes critical production bundles, as well as any change greater than 2%:
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| oss-stable/react-dom/cjs/react-dom.production.js | = | 6.66 kB | 6.66 kB | +0.11% | 1.82 kB | 1.82 kB |
| oss-experimental/react-dom/cjs/react-dom.production.js | = | 6.67 kB | 6.67 kB | +0.11% | 1.83 kB | 1.83 kB |
| facebook-www/ReactDOM-prod.classic.js | = | 591.11 kB | 591.11 kB | = | 103.94 kB | 103.94 kB |
| facebook-www/ReactDOM-prod.modern.js | = | 567.33 kB | 567.33 kB | = | 100.34 kB | 100.34 kB |
| test_utils/ReactAllWarnings.js | Deleted | 64.26 kB | 0.00 kB | Deleted | 16.02 kB | 0.00 kB |
Significant size changes
Includes any change greater than 0.2%:
Expand to show
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| test_utils/ReactAllWarnings.js | Deleted | 64.26 kB | 0.00 kB | Deleted | 16.02 kB | 0.00 kB |
Generated by :no_entry_sign: dangerJS against 6797b3666f30b09e3964eac152e36bb377ef8c83
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!