-
Notifications
You must be signed in to change notification settings - Fork 50k
Add __REACT_DEVTOOLS_HIDE_CONSOLE__ to suppress DevTools download message #35278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add __REACT_DEVTOOLS_HIDE_CONSOLE__ to suppress DevTools download message #35278
Conversation
|
Hi @more-shubham! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a __REACT_DEVTOOLS_HIDE_CONSOLE__ global variable to suppress the "Download the React DevTools" console message in environments where the browser extension cannot be installed, such as CEP or nwjs-like contexts. The implementation follows React's established pattern for global configuration variables and includes appropriate Flow type declarations and test coverage.
Key Changes:
- Adds Flow type declaration for
__REACT_DEVTOOLS_HIDE_CONSOLE__asvoid | true - Updates DevTools message display logic to check if suppression is enabled
- Includes test coverage to verify message suppression functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scripts/flow/environment.js |
Adds Flow type declaration for the new global variable as void | true, ensuring type safety |
packages/react-dom/src/client/ReactDOMClient.js |
Updates conditional logic to suppress DevTools message when __REACT_DEVTOOLS_HIDE_CONSOLE__ is defined |
packages/react-dom/src/client/ReactDOMClientFB.js |
Applies identical suppression logic for Facebook-internal build consistency |
packages/react-dom/src/__tests__/ReactDOM-test.js |
Adds test case verifying message suppression when global variable is set to true |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sage (facebook#24283) Add a global variable that allows suppressing the "Download the React DevTools" console message in environments where the Chrome extension cannot function, such as remote debugging environments and CEP-like contexts.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
df609dc to
b997d07
Compare
|
Hi! Just checking in on this PR. Is there anything I can improve or any feedback? Happy to make changes if needed. Thanks! |
Summary
Fixes #24283
__REACT_DEVTOOLS_HIDE_CONSOLE__global variable that suppresses the "Download the React DevTools" console messageTest plan
__REACT_DEVTOOLS_HIDE_CONSOLE__is set totrueyarn test ReactDOM-testto verify