Skip to content

Commit 85acf2d

Browse files
authored
Delete suppressWarning in OSS (#30312)
I'm pretty sure this is completely unnecessary even in www and RN because it's only useful if you use the mock scheduler which typically only we do in our own tests. But all our tests pass so unless www/RN does something with it, I don't think this is used. Also remove unnecessary `__DEV__` check. If it gets pulled in prod, we'd want to know about it.
1 parent 8e00cf0 commit 85acf2d

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

packages/shared/consoleWithStackDev.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
import ReactSharedInternals from 'shared/ReactSharedInternals';
99
import {enableOwnerStacks} from 'shared/ReactFeatureFlags';
1010

11-
let suppressWarning = false;
1211
export function setSuppressWarning(newSuppressWarning) {
13-
if (__DEV__) {
14-
suppressWarning = newSuppressWarning;
15-
}
12+
// TODO: Noop. Delete.
1613
}
1714

1815
// In DEV, calls to console.warn and console.error get replaced
@@ -22,19 +19,11 @@ export function setSuppressWarning(newSuppressWarning) {
2219
// they are left as they are instead.
2320

2421
export function warn(format, ...args) {
25-
if (__DEV__) {
26-
if (!suppressWarning) {
27-
printWarning('warn', format, args, new Error('react-stack-top-frame'));
28-
}
29-
}
22+
printWarning('warn', format, args, new Error('react-stack-top-frame'));
3023
}
3124

3225
export function error(format, ...args) {
33-
if (__DEV__) {
34-
if (!suppressWarning) {
35-
printWarning('error', format, args, new Error('react-stack-top-frame'));
36-
}
37-
}
26+
printWarning('error', format, args, new Error('react-stack-top-frame'));
3827
}
3928

4029
// eslint-disable-next-line react-internal/no-production-logging

0 commit comments

Comments
 (0)