Skip to content

Commit 06764ea

Browse files
committed
chore[react-devtools/renderer]: dont show strict mode warning for prod renderer builds
1 parent 2e72ea8 commit 06764ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-devtools-shared/src/backend/renderer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,12 +1984,17 @@ export function attach(
19841984
}
19851985

19861986
if (isRoot) {
1987+
// Set supportsStrictMode to false for production renderer builds
1988+
const isProductionBuildOfRenderer = renderer.bundleType === 0;
1989+
19871990
pushOperation(TREE_OPERATION_ADD);
19881991
pushOperation(id);
19891992
pushOperation(ElementTypeRoot);
19901993
pushOperation((fiber.mode & StrictModeBits) !== 0 ? 1 : 0);
19911994
pushOperation(profilingFlags);
1992-
pushOperation(StrictModeBits !== 0 ? 1 : 0);
1995+
pushOperation(
1996+
!isProductionBuildOfRenderer && StrictModeBits !== 0 ? 1 : 0,
1997+
);
19931998
pushOperation(hasOwnerMetadata ? 1 : 0);
19941999

19952000
if (isProfiling) {

0 commit comments

Comments
 (0)