@samitouri / QOS-React-1 / commits / 97c5e6c9e4

chore[react-devtools/renderer]: dont show strict mode warning for prod renderer builds (#30158)

## 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](https://github.com/facebook/react/assets/28902667/0154ab2a-435b-4317-b2e8-09083533acec) | ![Screenshot 2024-06-30 at 23 44 14](https://github.com/facebook/react/assets/28902667/b10ffc6e-dbed-43d8-bf08-11188a151009) |

Ruslan Lesiutin committed Jul 1, 2024 at 15:43 UTC 97c5e6c9e4b4c078602f2e5112777e078eed0dd7
1 file changed +6 -1
packages/react-devtools-shared/src/backend/renderer.js
+6 -1
@@ -1984,12 +1984,17 @@ export function attach(
1984 }
1985
1986 if (isRoot) {
1987 + // Set supportsStrictMode to false for production renderer builds
1988 + const isProductionBuildOfRenderer = renderer.bundleType === 0;
1989 +
1990 pushOperation(TREE_OPERATION_ADD);
1991 pushOperation(id);
1992 pushOperation(ElementTypeRoot);
1993 pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0);
1994 pushOperation(profilingFlags);
1992 - pushOperation(StrictModeBits !== 0 ? 1 : 0);
1995 + pushOperation(
1996 + !isProductionBuildOfRenderer && StrictModeBits !== 0 ? 1 : 0,
1997 + );
1998 pushOperation(hasOwnerMetadata ? 1 : 0);
1999
2000 if (isProfiling) {