Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Jul 1, 2024

Summary

We should not be showing StrictMode warnings when React is running in production, since StrictMode is a dev-only feature.

How did you test this change?

Before After
Screenshot 2024-06-30 at 23 42 41 Screenshot 2024-06-30 at 23 44 14

@hoxyq hoxyq requested review from eps1lon and vzaidman July 1, 2024 08:33
@vercel
Copy link

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 2:39pm


if (isRoot) {
// Set supportsStrictMode to false for production renderer builds
const isNonProductionBuildOfRenderer = renderer.bundleType > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

      const isProductionBuildOfRenderer = renderer.bundleType === 0;
      // ...
      !isProductionBuildOfRenderer && StrictModeBits !== 0 ? 1 : 0,

Copy link
Contributor

@vzaidman vzaidman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with a recommendation nit

@hoxyq hoxyq force-pushed the react-devtools/dont-show-strict-mode-warning-for-prod-builds branch from 352da5e to 06764ea Compare July 1, 2024 14:34
@hoxyq hoxyq merged commit 97c5e6c into facebook:main Jul 1, 2024
@hoxyq hoxyq deleted the react-devtools/dont-show-strict-mode-warning-for-prod-builds branch July 1, 2024 14:43
hoxyq added a commit that referenced this pull request Jul 3, 2024
## Summary

Full list of changes, mostly fixes:
* chore[react-devtools/renderer]: dont show strict mode warning for prod
renderer builds ([hoxyq](https://github.com/hoxyq) in
[#30158](#30158))
* chore[react-devtools/ui]: fix strict mode badge styles
([hoxyq](https://github.com/hoxyq) in
[#30159](#30159))
* fix[react-devtools]: restore original args when recording errors
([hoxyq](https://github.com/hoxyq) in
[#30091](#30091))
* Read constructor name more carefully
([LoganDark](https://github.com/LoganDark) in
[#29954](#29954))
* refactor[react-devtools/extensions]: dont debounce cleanup logic on
navigation ([hoxyq](https://github.com/hoxyq) in
[#30027](#30027))
* lint: enable reportUnusedDisableDirectives and remove unused
suppressions ([kassens](https://github.com/kassens) in
[#28721](#28721))
* fix[react-devtools/extensions]: propagate globals from env
([hoxyq](https://github.com/hoxyq) in
[#29963](#29963))
* refactor[react-devtools/tests]: use registered marks instead of
cleared in tests ([hoxyq](https://github.com/hoxyq) in
[#29929](#29929))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants