|
5 | 5 | * LICENSE file in the root directory of this source tree. |
6 | 6 | */ |
7 | 7 |
|
8 | | -export function setSuppressWarning(newSuppressWarning) { |
9 | | - // TODO: Noop. Delete. |
10 | | -} |
11 | | - |
12 | | -// In DEV, calls to console.warn and console.error get replaced |
13 | | -// by calls to these methods by a Babel plugin. |
| 8 | +// We expect that our Rollup, Jest, and Flow configurations |
| 9 | +// always shim this module with the corresponding environment |
| 10 | +// (either rn or www). |
14 | 11 | // |
15 | | -// In PROD (or in packages without access to React internals), |
16 | | -// they are left as they are instead. |
17 | | - |
18 | | -export function warn(format, ...args) { |
19 | | - if (__DEV__) { |
20 | | - printWarning('warn', format, args); |
21 | | - } |
22 | | -} |
23 | | - |
24 | | -export function error(format, ...args) { |
25 | | - if (__DEV__) { |
26 | | - printWarning('error', format, args); |
27 | | - } |
28 | | -} |
| 12 | +// We should never resolve to this file, but it exists to make |
| 13 | +// sure that if we *do* accidentally break the configuration, |
| 14 | +// the failure isn't silent. |
29 | 15 |
|
30 | | -function printWarning(level, format, args) { |
31 | | - // When changing this logic, you might want to also |
32 | | - // update consoleWithStackDev.www.js as well. |
33 | | - if (__DEV__) { |
34 | | - args.unshift(format); |
35 | | - // We intentionally don't use spread (or .apply) directly because it |
36 | | - // breaks IE9: https://github.com/facebook/react/issues/13610 |
37 | | - // eslint-disable-next-line react-internal/no-production-logging |
38 | | - Function.prototype.apply.call(console[level], console, args); |
39 | | - } |
| 16 | +export function setSuppressWarning() { |
| 17 | + // TODO: Delete this and error when even importing this module. |
40 | 18 | } |
0 commit comments