Skip to content

Conversation

@more-shubham
Copy link

Summary

Fixes #24283

  • Adds a __REACT_DEVTOOLS_HIDE_CONSOLE__ global variable that suppresses the "Download the React DevTools" console message
  • Useful for remote debugging environments (CEP, nwjs-like contexts) where the Chrome extension cannot function
  • Includes Flow type declaration and test coverage

Test plan

  • Added unit test that verifies the message is suppressed when __REACT_DEVTOOLS_HIDE_CONSOLE__ is set to true
  • Run yarn test ReactDOM-test to verify

Copilot AI review requested due to automatic review settings December 3, 2025 16:46
@meta-cla
Copy link

meta-cla bot commented Dec 3, 2025

Hi @more-shubham!

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!

Copilot finished reviewing on behalf of more-shubham December 3, 2025 16:49
Copy link

Copilot AI left a 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__ as void | 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.

@meta-cla meta-cla bot added the CLA Signed label Dec 3, 2025
more-shubham and others added 3 commits December 4, 2025 11:58
…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.
@more-shubham more-shubham force-pushed the fix/suppress-devtools-download-message-24283 branch from df609dc to b997d07 Compare December 4, 2025 06:28
@more-shubham
Copy link
Author

Hi! Just checking in on this PR. Is there anything I can improve or any feedback? Happy to make changes if needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress "Download the React DevTools" log for a better development experience

1 participant