react-dom 19.0.0-rc.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,79 +8,17 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
-
17
- var React = require('react');
18
-
19
- var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
20
-
21
- function error(format) {
22
- {
23
- {
24
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
25
- args[_key2 - 1] = arguments[_key2];
26
- }
27
-
28
- printWarning('error', format, args);
29
- }
30
- }
31
- } // eslint-disable-next-line react-internal/no-production-logging
32
-
33
- function printWarning(level, format, args) {
34
- // When changing this logic, you might want to also
35
- // update consoleWithStackDev.www.js as well.
36
- {
37
- var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
38
-
39
- if (ReactSharedInternals.getCurrentStack) {
40
- // We only add the current stack to the console when createTask is not supported.
41
- // Since createTask requires DevTools to be open to work, this means that stacks
42
- // can be lost while DevTools isn't open but we can't detect this.
43
- var stack = ReactSharedInternals.getCurrentStack();
44
-
45
- if (stack !== '') {
46
- format += '%s';
47
- args = args.concat([stack]);
48
- }
49
- }
50
-
51
- if (isErrorLogger) {
52
- // Don't prefix our default logging formatting in ReactFiberErrorLoggger.
53
- // Don't toString the arguments.
54
- args.unshift(format);
55
- } else {
56
- // TODO: Remove this prefix and stop toStringing in the wrapper and
57
- // instead do it at each callsite as needed.
58
- // Careful: RN currently depends on this prefix
59
- // eslint-disable-next-line react-internal/safe-string-coercion
60
- args = args.map(function (item) {
61
- return String(item);
62
- });
63
- args.unshift('Warning: ' + format);
64
- } // We intentionally don't use spread (or .apply) directly because it
65
- // breaks IE9: https://github.com/facebook/react/issues/13610
66
- // eslint-disable-next-line react-internal/no-production-logging
67
-
68
-
69
- Function.prototype.apply.call(console[level], console, args);
70
- }
71
- }
72
-
73
- var didWarnAboutUsingAct = false;
74
- function act(callback) {
75
- if (didWarnAboutUsingAct === false) {
76
- didWarnAboutUsingAct = true;
77
-
78
- error('`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. ' + 'Import `act` from `react` instead of `react-dom/test-utils`. ' + 'See https://react.dev/warnings/react-dom-test-utils for more info.');
79
- }
80
-
81
- return React.act(callback);
82
- }
83
-
84
- exports.act = act;
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ var React = require("react"),
15
+ didWarnAboutUsingAct = !1;
16
+ exports.act = function (callback) {
17
+ !1 === didWarnAboutUsingAct &&
18
+ ((didWarnAboutUsingAct = !0),
19
+ console.error(
20
+ "`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info."
21
+ ));
22
+ return React.act(callback);
23
+ };
85
24
  })();
86
- }