react 19.0.0-rc-20b6f4c0e8-20240607 → 19.0.0-rc-a532d91d01-20240610
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.
- package/cjs/react-compiler-runtime.development.js +36 -81
- package/cjs/react-jsx-dev-runtime.development.js +643 -1225
- package/cjs/react-jsx-dev-runtime.react-server.development.js +654 -1260
- package/cjs/react-jsx-runtime.development.js +639 -1243
- package/cjs/react-jsx-runtime.react-server.development.js +654 -1260
- package/cjs/react.development.js +1507 -2761
- package/cjs/react.production.js +1 -1
- package/cjs/react.react-server.development.js +1093 -2047
- package/cjs/react.react-server.production.js +1 -1
- package/package.json +1 -1
@@ -8,1296 +8,690 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
23
|
-
|
24
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
25
|
-
// as a normal prop instead of stripping it from the props object.
|
26
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
27
|
-
// during element creation.
|
28
|
-
|
29
|
-
var enableRefAsProp = true;
|
30
|
-
|
31
|
-
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
32
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
33
|
-
// issues in DEV builds.
|
34
|
-
|
35
|
-
var enableDebugTracing = false;
|
36
|
-
|
37
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
38
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
39
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
40
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
41
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
42
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
43
|
-
|
44
|
-
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
45
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
46
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
47
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
48
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
49
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
50
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
51
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
52
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
53
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
54
|
-
function getIteratorFn(maybeIterable) {
|
55
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
56
|
-
return null;
|
57
|
-
}
|
58
|
-
|
59
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
60
|
-
|
61
|
-
if (typeof maybeIterator === 'function') {
|
62
|
-
return maybeIterator;
|
63
|
-
}
|
64
|
-
|
65
|
-
return null;
|
66
|
-
}
|
67
|
-
|
68
|
-
var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
|
69
|
-
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
70
|
-
|
71
|
-
if (!ReactSharedInternalsServer) {
|
72
|
-
throw new Error('The "react" package in this environment is not configured correctly. ' + 'The "react-server" condition must be enabled in any environment that ' + 'runs React Server Components.');
|
73
|
-
}
|
74
|
-
|
75
|
-
function error(format) {
|
76
|
-
{
|
77
|
-
{
|
78
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
11
|
+
"use strict";
|
12
|
+
"production" !== process.env.NODE_ENV &&
|
13
|
+
(function () {
|
14
|
+
function error(format) {
|
15
|
+
for (
|
16
|
+
var _len2 = arguments.length,
|
17
|
+
args = Array(1 < _len2 ? _len2 - 1 : 0),
|
18
|
+
_key2 = 1;
|
19
|
+
_key2 < _len2;
|
20
|
+
_key2++
|
21
|
+
)
|
79
22
|
args[_key2 - 1] = arguments[_key2];
|
23
|
+
printWarning("error", format, args, Error("react-stack-top-frame"));
|
24
|
+
}
|
25
|
+
function printWarning(level, format, args, currentStack) {
|
26
|
+
var isErrorLogger =
|
27
|
+
"%s\n\n%s\n" === format || "%o\n\n%s\n\n%s\n" === format;
|
28
|
+
ReactSharedInternalsServer.getCurrentStack &&
|
29
|
+
((currentStack =
|
30
|
+
ReactSharedInternalsServer.getCurrentStack(currentStack)),
|
31
|
+
"" !== currentStack &&
|
32
|
+
((format += "%s"), (args = args.concat([currentStack]))));
|
33
|
+
isErrorLogger
|
34
|
+
? args.unshift(format)
|
35
|
+
: ((args = args.map(function (item) {
|
36
|
+
return String(item);
|
37
|
+
})),
|
38
|
+
args.unshift("Warning: " + format));
|
39
|
+
Function.prototype.apply.call(console[level], console, args);
|
40
|
+
}
|
41
|
+
function getComponentNameFromType(type) {
|
42
|
+
if (null == type) return null;
|
43
|
+
if ("function" === typeof type)
|
44
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE$2
|
45
|
+
? null
|
46
|
+
: type.displayName || type.name || null;
|
47
|
+
if ("string" === typeof type) return type;
|
48
|
+
switch (type) {
|
49
|
+
case REACT_FRAGMENT_TYPE:
|
50
|
+
return "Fragment";
|
51
|
+
case REACT_PORTAL_TYPE:
|
52
|
+
return "Portal";
|
53
|
+
case REACT_PROFILER_TYPE:
|
54
|
+
return "Profiler";
|
55
|
+
case REACT_STRICT_MODE_TYPE:
|
56
|
+
return "StrictMode";
|
57
|
+
case REACT_SUSPENSE_TYPE:
|
58
|
+
return "Suspense";
|
59
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
60
|
+
return "SuspenseList";
|
80
61
|
}
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
114
|
-
args = args.map(function (item) {
|
115
|
-
return String(item);
|
116
|
-
});
|
117
|
-
args.unshift('Warning: ' + format);
|
118
|
-
} // We intentionally don't use spread (or .apply) directly because it
|
119
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
120
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
121
|
-
|
122
|
-
|
123
|
-
Function.prototype.apply.call(console[level], console, args);
|
124
|
-
}
|
125
|
-
}
|
126
|
-
|
127
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
128
|
-
var displayName = outerType.displayName;
|
129
|
-
|
130
|
-
if (displayName) {
|
131
|
-
return displayName;
|
132
|
-
}
|
133
|
-
|
134
|
-
var functionName = innerType.displayName || innerType.name || '';
|
135
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
136
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
137
|
-
|
138
|
-
|
139
|
-
function getContextName(type) {
|
140
|
-
return type.displayName || 'Context';
|
141
|
-
}
|
142
|
-
|
143
|
-
var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
144
|
-
|
145
|
-
function getComponentNameFromType(type) {
|
146
|
-
if (type == null) {
|
147
|
-
// Host root, text node or just invalid type.
|
148
|
-
return null;
|
149
|
-
}
|
150
|
-
|
151
|
-
if (typeof type === 'function') {
|
152
|
-
if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
|
153
|
-
// TODO: Create a convention for naming client references with debug info.
|
154
|
-
return null;
|
155
|
-
}
|
156
|
-
|
157
|
-
return type.displayName || type.name || null;
|
158
|
-
}
|
159
|
-
|
160
|
-
if (typeof type === 'string') {
|
161
|
-
return type;
|
162
|
-
}
|
163
|
-
|
164
|
-
switch (type) {
|
165
|
-
case REACT_FRAGMENT_TYPE:
|
166
|
-
return 'Fragment';
|
167
|
-
|
168
|
-
case REACT_PORTAL_TYPE:
|
169
|
-
return 'Portal';
|
170
|
-
|
171
|
-
case REACT_PROFILER_TYPE:
|
172
|
-
return 'Profiler';
|
173
|
-
|
174
|
-
case REACT_STRICT_MODE_TYPE:
|
175
|
-
return 'StrictMode';
|
176
|
-
|
177
|
-
case REACT_SUSPENSE_TYPE:
|
178
|
-
return 'Suspense';
|
179
|
-
|
180
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
181
|
-
return 'SuspenseList';
|
182
|
-
|
183
|
-
}
|
184
|
-
|
185
|
-
if (typeof type === 'object') {
|
186
|
-
{
|
187
|
-
if (typeof type.tag === 'number') {
|
188
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
189
|
-
}
|
190
|
-
}
|
191
|
-
|
192
|
-
switch (type.$$typeof) {
|
193
|
-
case REACT_PROVIDER_TYPE:
|
194
|
-
{
|
195
|
-
return null;
|
196
|
-
}
|
197
|
-
|
198
|
-
case REACT_CONTEXT_TYPE:
|
199
|
-
var context = type;
|
200
|
-
|
201
|
-
{
|
202
|
-
return getContextName(context) + '.Provider';
|
203
|
-
}
|
204
|
-
|
205
|
-
case REACT_CONSUMER_TYPE:
|
206
|
-
{
|
207
|
-
var consumer = type;
|
208
|
-
return getContextName(consumer._context) + '.Consumer';
|
209
|
-
}
|
210
|
-
|
211
|
-
case REACT_FORWARD_REF_TYPE:
|
212
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
213
|
-
|
214
|
-
case REACT_MEMO_TYPE:
|
215
|
-
var outerName = type.displayName || null;
|
216
|
-
|
217
|
-
if (outerName !== null) {
|
218
|
-
return outerName;
|
219
|
-
}
|
220
|
-
|
221
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
222
|
-
|
223
|
-
case REACT_LAZY_TYPE:
|
224
|
-
{
|
225
|
-
var lazyComponent = type;
|
226
|
-
var payload = lazyComponent._payload;
|
227
|
-
var init = lazyComponent._init;
|
228
|
-
|
229
|
-
try {
|
230
|
-
return getComponentNameFromType(init(payload));
|
231
|
-
} catch (x) {
|
232
|
-
return null;
|
233
|
-
}
|
62
|
+
if ("object" === typeof type)
|
63
|
+
switch (
|
64
|
+
("number" === typeof type.tag &&
|
65
|
+
error(
|
66
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
67
|
+
),
|
68
|
+
type.$$typeof)
|
69
|
+
) {
|
70
|
+
case REACT_CONTEXT_TYPE:
|
71
|
+
return (type.displayName || "Context") + ".Provider";
|
72
|
+
case REACT_CONSUMER_TYPE:
|
73
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
74
|
+
case REACT_FORWARD_REF_TYPE:
|
75
|
+
var innerType = type.render;
|
76
|
+
type = type.displayName;
|
77
|
+
type ||
|
78
|
+
((type = innerType.displayName || innerType.name || ""),
|
79
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
80
|
+
return type;
|
81
|
+
case REACT_MEMO_TYPE:
|
82
|
+
return (
|
83
|
+
(innerType = type.displayName || null),
|
84
|
+
null !== innerType
|
85
|
+
? innerType
|
86
|
+
: getComponentNameFromType(type.type) || "Memo"
|
87
|
+
);
|
88
|
+
case REACT_LAZY_TYPE:
|
89
|
+
innerType = type._payload;
|
90
|
+
type = type._init;
|
91
|
+
try {
|
92
|
+
return getComponentNameFromType(type(innerType));
|
93
|
+
} catch (x) {}
|
234
94
|
}
|
95
|
+
return null;
|
235
96
|
}
|
236
|
-
|
237
|
-
|
238
|
-
return null;
|
239
|
-
}
|
240
|
-
|
241
|
-
// $FlowFixMe[method-unbinding]
|
242
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
243
|
-
|
244
|
-
var assign = Object.assign;
|
245
|
-
|
246
|
-
/*
|
247
|
-
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
248
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
249
|
-
*
|
250
|
-
* The functions in this module will throw an easier-to-understand,
|
251
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
252
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
253
|
-
* of the `value` object).
|
254
|
-
*/
|
255
|
-
// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
256
|
-
function typeName(value) {
|
257
|
-
{
|
258
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
259
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
260
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
|
261
|
-
|
262
|
-
return type;
|
263
|
-
}
|
264
|
-
} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
265
|
-
|
266
|
-
|
267
|
-
function willCoercionThrow(value) {
|
268
|
-
{
|
269
|
-
try {
|
270
|
-
testStringCoercion(value);
|
271
|
-
return false;
|
272
|
-
} catch (e) {
|
273
|
-
return true;
|
274
|
-
}
|
275
|
-
}
|
276
|
-
}
|
277
|
-
|
278
|
-
function testStringCoercion(value) {
|
279
|
-
// If you ended up here by following an exception call stack, here's what's
|
280
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
281
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
282
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
283
|
-
//
|
284
|
-
// The most common types that will cause this exception are `Symbol` instances
|
285
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
286
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
287
|
-
// exception. (Library authors do this to prevent users from using built-in
|
288
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
289
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
290
|
-
//
|
291
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
292
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
293
|
-
//
|
294
|
-
// To find which value is throwing, check the browser or debugger console.
|
295
|
-
// Before this exception was thrown, there should be `console.error` output
|
296
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
297
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
298
|
-
// In most cases, this console output also shows the component and its
|
299
|
-
// ancestor components where the exception happened.
|
300
|
-
//
|
301
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
302
|
-
return '' + value;
|
303
|
-
}
|
304
|
-
function checkKeyStringCoercion(value) {
|
305
|
-
{
|
306
|
-
if (willCoercionThrow(value)) {
|
307
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
|
308
|
-
|
309
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
310
|
-
}
|
311
|
-
}
|
312
|
-
}
|
313
|
-
|
314
|
-
var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
|
315
|
-
// TODO: Delete this when enableOwnerStacks ships.
|
316
|
-
|
317
|
-
function isValidElementType(type) {
|
318
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
319
|
-
return true;
|
320
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
321
|
-
|
322
|
-
|
323
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
|
324
|
-
return true;
|
325
|
-
}
|
326
|
-
|
327
|
-
if (typeof type === 'object' && type !== null) {
|
328
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
329
|
-
// types supported by any Flight configuration anywhere since
|
330
|
-
// we don't know which Flight build this will end up being used
|
331
|
-
// with.
|
332
|
-
type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
|
333
|
-
return true;
|
334
|
-
}
|
335
|
-
}
|
336
|
-
|
337
|
-
return false;
|
338
|
-
}
|
339
|
-
|
340
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
341
|
-
|
342
|
-
function isArray(a) {
|
343
|
-
return isArrayImpl(a);
|
344
|
-
}
|
345
|
-
|
346
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
347
|
-
// replaying on render function. This currently only patches the object
|
348
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
349
|
-
// We could also eagerly patch the method.
|
350
|
-
var disabledDepth = 0;
|
351
|
-
var prevLog;
|
352
|
-
var prevInfo;
|
353
|
-
var prevWarn;
|
354
|
-
var prevError;
|
355
|
-
var prevGroup;
|
356
|
-
var prevGroupCollapsed;
|
357
|
-
var prevGroupEnd;
|
358
|
-
|
359
|
-
function disabledLog() {}
|
360
|
-
|
361
|
-
disabledLog.__reactDisabledLog = true;
|
362
|
-
function disableLogs() {
|
363
|
-
{
|
364
|
-
if (disabledDepth === 0) {
|
365
|
-
/* eslint-disable react-internal/no-production-logging */
|
366
|
-
prevLog = console.log;
|
367
|
-
prevInfo = console.info;
|
368
|
-
prevWarn = console.warn;
|
369
|
-
prevError = console.error;
|
370
|
-
prevGroup = console.group;
|
371
|
-
prevGroupCollapsed = console.groupCollapsed;
|
372
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
373
|
-
|
374
|
-
var props = {
|
375
|
-
configurable: true,
|
376
|
-
enumerable: true,
|
377
|
-
value: disabledLog,
|
378
|
-
writable: true
|
379
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
380
|
-
|
381
|
-
Object.defineProperties(console, {
|
382
|
-
info: props,
|
383
|
-
log: props,
|
384
|
-
warn: props,
|
385
|
-
error: props,
|
386
|
-
group: props,
|
387
|
-
groupCollapsed: props,
|
388
|
-
groupEnd: props
|
389
|
-
});
|
390
|
-
/* eslint-enable react-internal/no-production-logging */
|
391
|
-
}
|
392
|
-
|
393
|
-
disabledDepth++;
|
394
|
-
}
|
395
|
-
}
|
396
|
-
function reenableLogs() {
|
397
|
-
{
|
398
|
-
disabledDepth--;
|
399
|
-
|
400
|
-
if (disabledDepth === 0) {
|
401
|
-
/* eslint-disable react-internal/no-production-logging */
|
402
|
-
var props = {
|
403
|
-
configurable: true,
|
404
|
-
enumerable: true,
|
405
|
-
writable: true
|
406
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
407
|
-
|
408
|
-
Object.defineProperties(console, {
|
409
|
-
log: assign({}, props, {
|
410
|
-
value: prevLog
|
411
|
-
}),
|
412
|
-
info: assign({}, props, {
|
413
|
-
value: prevInfo
|
414
|
-
}),
|
415
|
-
warn: assign({}, props, {
|
416
|
-
value: prevWarn
|
417
|
-
}),
|
418
|
-
error: assign({}, props, {
|
419
|
-
value: prevError
|
420
|
-
}),
|
421
|
-
group: assign({}, props, {
|
422
|
-
value: prevGroup
|
423
|
-
}),
|
424
|
-
groupCollapsed: assign({}, props, {
|
425
|
-
value: prevGroupCollapsed
|
426
|
-
}),
|
427
|
-
groupEnd: assign({}, props, {
|
428
|
-
value: prevGroupEnd
|
429
|
-
})
|
430
|
-
});
|
431
|
-
/* eslint-enable react-internal/no-production-logging */
|
432
|
-
}
|
433
|
-
|
434
|
-
if (disabledDepth < 0) {
|
435
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
97
|
+
function testStringCoercion(value) {
|
98
|
+
return "" + value;
|
436
99
|
}
|
437
|
-
|
438
|
-
}
|
439
|
-
|
440
|
-
var prefix;
|
441
|
-
function describeBuiltInComponentFrame(name) {
|
442
|
-
{
|
443
|
-
if (prefix === undefined) {
|
444
|
-
// Extract the VM specific prefix used by each line.
|
100
|
+
function checkKeyStringCoercion(value) {
|
445
101
|
try {
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
102
|
+
testStringCoercion(value);
|
103
|
+
var JSCompiler_inline_result = !1;
|
104
|
+
} catch (e) {
|
105
|
+
JSCompiler_inline_result = !0;
|
450
106
|
}
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
reentry = true;
|
492
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
|
493
|
-
|
494
|
-
Error.prepareStackTrace = undefined;
|
495
|
-
var previousDispatcher = null;
|
496
|
-
|
497
|
-
{
|
498
|
-
previousDispatcher = ReactSharedInternalsServer.H; // Set the dispatcher in DEV because this might be call in the render function
|
499
|
-
// for warnings.
|
500
|
-
|
501
|
-
ReactSharedInternalsServer.H = null;
|
502
|
-
disableLogs();
|
503
|
-
}
|
504
|
-
/**
|
505
|
-
* Finding a common stack frame between sample and control errors can be
|
506
|
-
* tricky given the different types and levels of stack trace truncation from
|
507
|
-
* different JS VMs. So instead we'll attempt to control what that common
|
508
|
-
* frame should be through this object method:
|
509
|
-
* Having both the sample and control errors be in the function under the
|
510
|
-
* `DescribeNativeComponentFrameRoot` property, + setting the `name` and
|
511
|
-
* `displayName` properties of the function ensures that a stack
|
512
|
-
* frame exists that has the method name `DescribeNativeComponentFrameRoot` in
|
513
|
-
* it for both control and sample stacks.
|
514
|
-
*/
|
515
|
-
|
516
|
-
|
517
|
-
var RunInRootFrame = {
|
518
|
-
DetermineComponentFrameRoot: function () {
|
519
|
-
var control;
|
520
|
-
|
521
|
-
try {
|
522
|
-
// This should throw.
|
523
|
-
if (construct) {
|
524
|
-
// Something should be setting the props in the constructor.
|
525
|
-
var Fake = function () {
|
526
|
-
throw Error();
|
527
|
-
}; // $FlowFixMe[prop-missing]
|
528
|
-
|
529
|
-
|
530
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
531
|
-
set: function () {
|
532
|
-
// We use a throwing setter instead of frozen or non-writable props
|
533
|
-
// because that won't throw in a non-strict mode function.
|
534
|
-
throw Error();
|
535
|
-
}
|
536
|
-
});
|
537
|
-
|
538
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
539
|
-
// We construct a different control for this case to include any extra
|
540
|
-
// frames added by the construct call.
|
541
|
-
try {
|
542
|
-
Reflect.construct(Fake, []);
|
543
|
-
} catch (x) {
|
544
|
-
control = x;
|
545
|
-
}
|
546
|
-
|
547
|
-
Reflect.construct(fn, [], Fake);
|
548
|
-
} else {
|
549
|
-
try {
|
550
|
-
Fake.call();
|
551
|
-
} catch (x) {
|
552
|
-
control = x;
|
553
|
-
} // $FlowFixMe[prop-missing] found when upgrading Flow
|
554
|
-
|
555
|
-
|
556
|
-
fn.call(Fake.prototype);
|
557
|
-
}
|
558
|
-
} else {
|
559
|
-
try {
|
560
|
-
throw Error();
|
561
|
-
} catch (x) {
|
562
|
-
control = x;
|
563
|
-
} // TODO(luna): This will currently only throw if the function component
|
564
|
-
// tries to access React/ReactDOM/props. We should probably make this throw
|
565
|
-
// in simple components too
|
566
|
-
|
567
|
-
|
568
|
-
var maybePromise = fn(); // If the function component returns a promise, it's likely an async
|
569
|
-
// component, which we don't yet support. Attach a noop catch handler to
|
570
|
-
// silence the error.
|
571
|
-
// TODO: Implement component stacks for async client components?
|
572
|
-
|
573
|
-
if (maybePromise && typeof maybePromise.catch === 'function') {
|
574
|
-
maybePromise.catch(function () {});
|
575
|
-
}
|
576
|
-
}
|
577
|
-
} catch (sample) {
|
578
|
-
// This is inlined manually because closure doesn't do it for us.
|
579
|
-
if (sample && control && typeof sample.stack === 'string') {
|
580
|
-
return [sample.stack, control.stack];
|
581
|
-
}
|
107
|
+
if (JSCompiler_inline_result)
|
108
|
+
return (
|
109
|
+
(JSCompiler_inline_result =
|
110
|
+
("function" === typeof Symbol &&
|
111
|
+
Symbol.toStringTag &&
|
112
|
+
value[Symbol.toStringTag]) ||
|
113
|
+
value.constructor.name ||
|
114
|
+
"Object"),
|
115
|
+
error(
|
116
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
117
|
+
JSCompiler_inline_result
|
118
|
+
),
|
119
|
+
testStringCoercion(value)
|
120
|
+
);
|
121
|
+
}
|
122
|
+
function disabledLog() {}
|
123
|
+
function disableLogs() {
|
124
|
+
if (0 === disabledDepth) {
|
125
|
+
prevLog = console.log;
|
126
|
+
prevInfo = console.info;
|
127
|
+
prevWarn = console.warn;
|
128
|
+
prevError = console.error;
|
129
|
+
prevGroup = console.group;
|
130
|
+
prevGroupCollapsed = console.groupCollapsed;
|
131
|
+
prevGroupEnd = console.groupEnd;
|
132
|
+
var props = {
|
133
|
+
configurable: !0,
|
134
|
+
enumerable: !0,
|
135
|
+
value: disabledLog,
|
136
|
+
writable: !0
|
137
|
+
};
|
138
|
+
Object.defineProperties(console, {
|
139
|
+
info: props,
|
140
|
+
log: props,
|
141
|
+
warn: props,
|
142
|
+
error: props,
|
143
|
+
group: props,
|
144
|
+
groupCollapsed: props,
|
145
|
+
groupEnd: props
|
146
|
+
});
|
582
147
|
}
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
});
|
599
|
-
}
|
600
|
-
|
601
|
-
try {
|
602
|
-
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
|
603
|
-
sampleStack = _RunInRootFrame$Deter[0],
|
604
|
-
controlStack = _RunInRootFrame$Deter[1];
|
605
|
-
|
606
|
-
if (sampleStack && controlStack) {
|
607
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
608
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
609
|
-
var sampleLines = sampleStack.split('\n');
|
610
|
-
var controlLines = controlStack.split('\n');
|
611
|
-
var s = 0;
|
612
|
-
var c = 0;
|
613
|
-
|
614
|
-
while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
|
615
|
-
s++;
|
148
|
+
disabledDepth++;
|
149
|
+
}
|
150
|
+
function reenableLogs() {
|
151
|
+
disabledDepth--;
|
152
|
+
if (0 === disabledDepth) {
|
153
|
+
var props = { configurable: !0, enumerable: !0, writable: !0 };
|
154
|
+
Object.defineProperties(console, {
|
155
|
+
log: assign({}, props, { value: prevLog }),
|
156
|
+
info: assign({}, props, { value: prevInfo }),
|
157
|
+
warn: assign({}, props, { value: prevWarn }),
|
158
|
+
error: assign({}, props, { value: prevError }),
|
159
|
+
group: assign({}, props, { value: prevGroup }),
|
160
|
+
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
161
|
+
groupEnd: assign({}, props, { value: prevGroupEnd })
|
162
|
+
});
|
616
163
|
}
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
630
|
-
// We expect at least one stack frame to be shared.
|
631
|
-
// Typically this will be the root most one. However, stack frames may be
|
632
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
633
|
-
// earlier than the other. We assume that the sample is longer or the same
|
634
|
-
// and there for cut off earlier. So we should find the root most frame in
|
635
|
-
// the sample somewhere in the control.
|
636
|
-
c--;
|
164
|
+
0 > disabledDepth &&
|
165
|
+
error(
|
166
|
+
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
167
|
+
);
|
168
|
+
}
|
169
|
+
function describeBuiltInComponentFrame(name) {
|
170
|
+
if (void 0 === prefix)
|
171
|
+
try {
|
172
|
+
throw Error();
|
173
|
+
} catch (x) {
|
174
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
175
|
+
prefix = (match && match[1]) || "";
|
637
176
|
}
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
663
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
177
|
+
return "\n" + prefix + name;
|
178
|
+
}
|
179
|
+
function describeNativeComponentFrame(fn, construct) {
|
180
|
+
if (!fn || reentry) return "";
|
181
|
+
var frame = componentFrameCache.get(fn);
|
182
|
+
if (void 0 !== frame) return frame;
|
183
|
+
reentry = !0;
|
184
|
+
frame = Error.prepareStackTrace;
|
185
|
+
Error.prepareStackTrace = void 0;
|
186
|
+
var previousDispatcher = null;
|
187
|
+
previousDispatcher = ReactSharedInternalsServer.H;
|
188
|
+
ReactSharedInternalsServer.H = null;
|
189
|
+
disableLogs();
|
190
|
+
var RunInRootFrame = {
|
191
|
+
DetermineComponentFrameRoot: function () {
|
192
|
+
try {
|
193
|
+
if (construct) {
|
194
|
+
var Fake = function () {
|
195
|
+
throw Error();
|
196
|
+
};
|
197
|
+
Object.defineProperty(Fake.prototype, "props", {
|
198
|
+
set: function () {
|
199
|
+
throw Error();
|
664
200
|
}
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
201
|
+
});
|
202
|
+
if ("object" === typeof Reflect && Reflect.construct) {
|
203
|
+
try {
|
204
|
+
Reflect.construct(Fake, []);
|
205
|
+
} catch (x) {
|
206
|
+
var control = x;
|
207
|
+
}
|
208
|
+
Reflect.construct(fn, [], Fake);
|
209
|
+
} else {
|
210
|
+
try {
|
211
|
+
Fake.call();
|
212
|
+
} catch (x$0) {
|
213
|
+
control = x$0;
|
214
|
+
}
|
215
|
+
fn.call(Fake.prototype);
|
216
|
+
}
|
217
|
+
} else {
|
218
|
+
try {
|
219
|
+
throw Error();
|
220
|
+
} catch (x$1) {
|
221
|
+
control = x$1;
|
674
222
|
}
|
675
|
-
|
223
|
+
(Fake = fn()) &&
|
224
|
+
"function" === typeof Fake.catch &&
|
225
|
+
Fake.catch(function () {});
|
226
|
+
}
|
227
|
+
} catch (sample) {
|
228
|
+
if (sample && control && "string" === typeof sample.stack)
|
229
|
+
return [sample.stack, control.stack];
|
676
230
|
}
|
677
|
-
|
678
|
-
break;
|
231
|
+
return [null, null];
|
679
232
|
}
|
680
|
-
}
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
233
|
+
};
|
234
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
235
|
+
"DetermineComponentFrameRoot";
|
236
|
+
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
237
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
238
|
+
"name"
|
239
|
+
);
|
240
|
+
namePropDescriptor &&
|
241
|
+
namePropDescriptor.configurable &&
|
242
|
+
Object.defineProperty(
|
243
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
244
|
+
"name",
|
245
|
+
{ value: "DetermineComponentFrameRoot" }
|
246
|
+
);
|
247
|
+
try {
|
248
|
+
var _RunInRootFrame$Deter =
|
249
|
+
RunInRootFrame.DetermineComponentFrameRoot(),
|
250
|
+
sampleStack = _RunInRootFrame$Deter[0],
|
251
|
+
controlStack = _RunInRootFrame$Deter[1];
|
252
|
+
if (sampleStack && controlStack) {
|
253
|
+
var sampleLines = sampleStack.split("\n"),
|
254
|
+
controlLines = controlStack.split("\n");
|
255
|
+
for (
|
256
|
+
sampleStack = _RunInRootFrame$Deter = 0;
|
257
|
+
_RunInRootFrame$Deter < sampleLines.length &&
|
258
|
+
!sampleLines[_RunInRootFrame$Deter].includes(
|
259
|
+
"DetermineComponentFrameRoot"
|
260
|
+
);
|
261
|
+
|
262
|
+
)
|
263
|
+
_RunInRootFrame$Deter++;
|
264
|
+
for (
|
265
|
+
;
|
266
|
+
sampleStack < controlLines.length &&
|
267
|
+
!controlLines[sampleStack].includes("DetermineComponentFrameRoot");
|
268
|
+
|
269
|
+
)
|
270
|
+
sampleStack++;
|
271
|
+
if (
|
272
|
+
_RunInRootFrame$Deter === sampleLines.length ||
|
273
|
+
sampleStack === controlLines.length
|
274
|
+
)
|
275
|
+
for (
|
276
|
+
_RunInRootFrame$Deter = sampleLines.length - 1,
|
277
|
+
sampleStack = controlLines.length - 1;
|
278
|
+
1 <= _RunInRootFrame$Deter &&
|
279
|
+
0 <= sampleStack &&
|
280
|
+
sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack];
|
281
|
+
|
282
|
+
)
|
283
|
+
sampleStack--;
|
284
|
+
for (
|
285
|
+
;
|
286
|
+
1 <= _RunInRootFrame$Deter && 0 <= sampleStack;
|
287
|
+
_RunInRootFrame$Deter--, sampleStack--
|
288
|
+
)
|
289
|
+
if (
|
290
|
+
sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]
|
291
|
+
) {
|
292
|
+
if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) {
|
293
|
+
do
|
294
|
+
if (
|
295
|
+
(_RunInRootFrame$Deter--,
|
296
|
+
sampleStack--,
|
297
|
+
0 > sampleStack ||
|
298
|
+
sampleLines[_RunInRootFrame$Deter] !==
|
299
|
+
controlLines[sampleStack])
|
300
|
+
) {
|
301
|
+
var _frame =
|
302
|
+
"\n" +
|
303
|
+
sampleLines[_RunInRootFrame$Deter].replace(
|
304
|
+
" at new ",
|
305
|
+
" at "
|
306
|
+
);
|
307
|
+
fn.displayName &&
|
308
|
+
_frame.includes("<anonymous>") &&
|
309
|
+
(_frame = _frame.replace("<anonymous>", fn.displayName));
|
310
|
+
"function" === typeof fn &&
|
311
|
+
componentFrameCache.set(fn, _frame);
|
312
|
+
return _frame;
|
313
|
+
}
|
314
|
+
while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack);
|
315
|
+
}
|
316
|
+
break;
|
317
|
+
}
|
760
318
|
}
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
768
|
-
|
769
|
-
function getOwner() {
|
770
|
-
{
|
771
|
-
var dispatcher = ReactSharedInternalsServer.A;
|
772
|
-
|
773
|
-
if (dispatcher === null) {
|
774
|
-
return null;
|
775
|
-
}
|
776
|
-
|
777
|
-
return dispatcher.getOwner();
|
778
|
-
}
|
779
|
-
}
|
780
|
-
|
781
|
-
var specialPropKeyWarningShown;
|
782
|
-
var didWarnAboutElementRef;
|
783
|
-
|
784
|
-
{
|
785
|
-
didWarnAboutElementRef = {};
|
786
|
-
}
|
787
|
-
|
788
|
-
function hasValidRef(config) {
|
789
|
-
{
|
790
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
791
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
792
|
-
|
793
|
-
if (getter && getter.isReactWarning) {
|
794
|
-
return false;
|
319
|
+
} finally {
|
320
|
+
(reentry = !1),
|
321
|
+
(ReactSharedInternalsServer.H = previousDispatcher),
|
322
|
+
reenableLogs(),
|
323
|
+
(Error.prepareStackTrace = frame);
|
795
324
|
}
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
function
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
}
|
811
|
-
}
|
812
|
-
|
813
|
-
return config.key !== undefined;
|
814
|
-
}
|
815
|
-
|
816
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
817
|
-
{
|
818
|
-
var warnAboutAccessingKey = function () {
|
819
|
-
if (!specialPropKeyWarningShown) {
|
820
|
-
specialPropKeyWarningShown = true;
|
821
|
-
|
822
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName);
|
823
|
-
}
|
824
|
-
};
|
825
|
-
|
826
|
-
warnAboutAccessingKey.isReactWarning = true;
|
827
|
-
Object.defineProperty(props, 'key', {
|
828
|
-
get: warnAboutAccessingKey,
|
829
|
-
configurable: true
|
830
|
-
});
|
831
|
-
}
|
832
|
-
}
|
833
|
-
|
834
|
-
function elementRefGetterWithDeprecationWarning() {
|
835
|
-
{
|
836
|
-
var componentName = getComponentNameFromType(this.type);
|
837
|
-
|
838
|
-
if (!didWarnAboutElementRef[componentName]) {
|
839
|
-
didWarnAboutElementRef[componentName] = true;
|
840
|
-
|
841
|
-
error('Accessing element.ref was removed in React 19. ref is now a ' + 'regular prop. It will be removed from the JSX Element ' + 'type in a future release.');
|
842
|
-
} // An undefined `element.ref` is coerced to `null` for
|
843
|
-
// backwards compatibility.
|
844
|
-
|
845
|
-
|
846
|
-
var refProp = this.props.ref;
|
847
|
-
return refProp !== undefined ? refProp : null;
|
848
|
-
}
|
849
|
-
}
|
850
|
-
/**
|
851
|
-
* Factory method to create a new React element. This no longer adheres to
|
852
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
853
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
|
854
|
-
* if something is a React Element.
|
855
|
-
*
|
856
|
-
* @param {*} type
|
857
|
-
* @param {*} props
|
858
|
-
* @param {*} key
|
859
|
-
* @param {string|object} ref
|
860
|
-
* @param {*} owner
|
861
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
862
|
-
* different from the `owner` when React.createElement is called, so that we
|
863
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
864
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
865
|
-
* change in behavior.
|
866
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
867
|
-
* indicating filename, line number, and/or other information.
|
868
|
-
* @internal
|
869
|
-
*/
|
870
|
-
|
871
|
-
|
872
|
-
function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
|
873
|
-
var ref;
|
874
|
-
|
875
|
-
{
|
876
|
-
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
877
|
-
// argument and treat `props.ref` as the source of truth. The only thing we
|
878
|
-
// use this for is `element.ref`, which will log a deprecation warning on
|
879
|
-
// access. In the next release, we can remove `element.ref` as well as the
|
880
|
-
// `ref` argument.
|
881
|
-
var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
882
|
-
// backwards compatibility.
|
883
|
-
|
884
|
-
ref = refProp !== undefined ? refProp : null;
|
885
|
-
}
|
886
|
-
|
887
|
-
var element;
|
888
|
-
|
889
|
-
{
|
890
|
-
// In dev, make `ref` a non-enumerable property with a warning. It's non-
|
891
|
-
// enumerable so that test matchers and serializers don't access it and
|
892
|
-
// trigger the warning.
|
893
|
-
//
|
894
|
-
// `ref` will be removed from the element completely in a future release.
|
895
|
-
element = {
|
896
|
-
// This tag allows us to uniquely identify this as a React Element
|
897
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
898
|
-
// Built-in properties that belong on the element
|
899
|
-
type: type,
|
900
|
-
key: key,
|
901
|
-
props: props,
|
902
|
-
// Record the component responsible for creating this element.
|
903
|
-
_owner: owner
|
904
|
-
};
|
905
|
-
|
906
|
-
if (ref !== null) {
|
907
|
-
Object.defineProperty(element, 'ref', {
|
908
|
-
enumerable: false,
|
909
|
-
get: elementRefGetterWithDeprecationWarning
|
910
|
-
});
|
911
|
-
} else {
|
912
|
-
// Don't warn on access if a ref is not given. This reduces false
|
913
|
-
// positives in cases where a test serializer uses
|
914
|
-
// getOwnPropertyDescriptors to compare objects, like Jest does, which is
|
915
|
-
// a problem because it bypasses non-enumerability.
|
916
|
-
//
|
917
|
-
// So unfortunately this will trigger a false positive warning in Jest
|
918
|
-
// when the diff is printed:
|
919
|
-
//
|
920
|
-
// expect(<div ref={ref} />).toEqual(<span ref={ref} />);
|
921
|
-
//
|
922
|
-
// A bit sketchy, but this is what we've done for the `props.key` and
|
923
|
-
// `props.ref` accessors for years, which implies it will be good enough
|
924
|
-
// for `element.ref`, too. Let's see if anyone complains.
|
925
|
-
Object.defineProperty(element, 'ref', {
|
926
|
-
enumerable: false,
|
927
|
-
value: null
|
928
|
-
});
|
929
|
-
}
|
930
|
-
}
|
931
|
-
|
932
|
-
{
|
933
|
-
// The validation flag is currently mutative. We put it on
|
934
|
-
// an external backing store so that we can freeze the whole object.
|
935
|
-
// This can be replaced with a WeakMap once they are implemented in
|
936
|
-
// commonly used development environments.
|
937
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
938
|
-
// the validation flag non-enumerable (where possible, which should
|
939
|
-
// include every environment we run tests in), so the test framework
|
940
|
-
// ignores it.
|
941
|
-
|
942
|
-
Object.defineProperty(element._store, 'validated', {
|
943
|
-
configurable: false,
|
944
|
-
enumerable: false,
|
945
|
-
writable: true,
|
946
|
-
value: 0
|
947
|
-
}); // debugInfo contains Server Component debug information.
|
948
|
-
|
949
|
-
Object.defineProperty(element, '_debugInfo', {
|
950
|
-
configurable: false,
|
951
|
-
enumerable: false,
|
952
|
-
writable: true,
|
953
|
-
value: null
|
954
|
-
});
|
955
|
-
|
956
|
-
if (Object.freeze) {
|
957
|
-
Object.freeze(element.props);
|
958
|
-
Object.freeze(element);
|
959
|
-
}
|
960
|
-
}
|
961
|
-
|
962
|
-
return element;
|
963
|
-
}
|
964
|
-
// support `jsx` and `jsxs` when running in development. This supports the case
|
965
|
-
// where a third-party dependency ships code that was compiled for production;
|
966
|
-
// we want to still provide warnings in development.
|
967
|
-
//
|
968
|
-
// So these functions are the _dev_ implementations of the _production_
|
969
|
-
// API signatures.
|
970
|
-
//
|
971
|
-
// Since these functions are dev-only, it's ok to add an indirection here. They
|
972
|
-
// only exist to provide different versions of `isStaticChildren`. (We shouldn't
|
973
|
-
// use this pattern for the prod versions, though, because it will add an call
|
974
|
-
// frame.)
|
975
|
-
|
976
|
-
function jsxProdSignatureRunningInDevWithDynamicChildren(type, config, maybeKey, source, self) {
|
977
|
-
{
|
978
|
-
var isStaticChildren = false;
|
979
|
-
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
|
980
|
-
}
|
981
|
-
}
|
982
|
-
function jsxProdSignatureRunningInDevWithStaticChildren(type, config, maybeKey, source, self) {
|
983
|
-
{
|
984
|
-
var isStaticChildren = true;
|
985
|
-
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
|
986
|
-
}
|
987
|
-
}
|
988
|
-
var didWarnAboutKeySpread = {};
|
989
|
-
/**
|
990
|
-
* https://github.com/reactjs/rfcs/pull/107
|
991
|
-
* @param {*} type
|
992
|
-
* @param {object} props
|
993
|
-
* @param {string} key
|
994
|
-
*/
|
995
|
-
|
996
|
-
function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
997
|
-
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
|
998
|
-
}
|
999
|
-
|
1000
|
-
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
1001
|
-
{
|
1002
|
-
if (!isValidElementType(type)) {
|
1003
|
-
// This is an invalid element type.
|
1004
|
-
//
|
1005
|
-
// We warn in this case but don't throw. We expect the element creation to
|
1006
|
-
// succeed and there will likely be errors in render.
|
1007
|
-
var info = '';
|
1008
|
-
|
1009
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1010
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
325
|
+
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
|
326
|
+
? describeBuiltInComponentFrame(sampleLines)
|
327
|
+
: "";
|
328
|
+
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
329
|
+
return sampleLines;
|
330
|
+
}
|
331
|
+
function describeUnknownElementTypeFrameInDEV(type) {
|
332
|
+
if (null == type) return "";
|
333
|
+
if ("function" === typeof type) {
|
334
|
+
var prototype = type.prototype;
|
335
|
+
return describeNativeComponentFrame(
|
336
|
+
type,
|
337
|
+
!(!prototype || !prototype.isReactComponent)
|
338
|
+
);
|
1011
339
|
}
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
typeString = 'array';
|
1019
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1020
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
1021
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
1022
|
-
} else {
|
1023
|
-
typeString = typeof type;
|
340
|
+
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
341
|
+
switch (type) {
|
342
|
+
case REACT_SUSPENSE_TYPE:
|
343
|
+
return describeBuiltInComponentFrame("Suspense");
|
344
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
345
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
1024
346
|
}
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
if (isStaticChildren) {
|
1038
|
-
if (isArray(children)) {
|
1039
|
-
for (var i = 0; i < children.length; i++) {
|
1040
|
-
validateChildKeys(children[i], type);
|
1041
|
-
}
|
1042
|
-
|
1043
|
-
if (Object.freeze) {
|
1044
|
-
Object.freeze(children);
|
1045
|
-
}
|
1046
|
-
} else {
|
1047
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
1048
|
-
}
|
1049
|
-
} else {
|
1050
|
-
validateChildKeys(children, type);
|
347
|
+
if ("object" === typeof type)
|
348
|
+
switch (type.$$typeof) {
|
349
|
+
case REACT_FORWARD_REF_TYPE:
|
350
|
+
return (type = describeNativeComponentFrame(type.render, !1)), type;
|
351
|
+
case REACT_MEMO_TYPE:
|
352
|
+
return describeUnknownElementTypeFrameInDEV(type.type);
|
353
|
+
case REACT_LAZY_TYPE:
|
354
|
+
prototype = type._payload;
|
355
|
+
type = type._init;
|
356
|
+
try {
|
357
|
+
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
358
|
+
} catch (x) {}
|
1051
359
|
}
|
1052
|
-
|
1053
|
-
} // Warn about key spread regardless of whether the type is valid.
|
1054
|
-
|
1055
|
-
|
1056
|
-
if (hasOwnProperty.call(config, 'key')) {
|
1057
|
-
var componentName = getComponentNameFromType(type);
|
1058
|
-
var keys = Object.keys(config).filter(function (k) {
|
1059
|
-
return k !== 'key';
|
1060
|
-
});
|
1061
|
-
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
1062
|
-
|
1063
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
1064
|
-
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
1065
|
-
|
1066
|
-
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
1067
|
-
|
1068
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
1069
|
-
}
|
360
|
+
return "";
|
1070
361
|
}
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
1075
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
1076
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
1077
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
1078
|
-
// key is explicitly declared to be undefined or not.
|
1079
|
-
|
1080
|
-
if (maybeKey !== undefined) {
|
1081
|
-
{
|
1082
|
-
checkKeyStringCoercion(maybeKey);
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
key = '' + maybeKey;
|
362
|
+
function getOwner() {
|
363
|
+
var dispatcher = ReactSharedInternalsServer.A;
|
364
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
1086
365
|
}
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
366
|
+
function hasValidRef(config) {
|
367
|
+
if (hasOwnProperty.call(config, "ref")) {
|
368
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
369
|
+
if (getter && getter.isReactWarning) return !1;
|
1091
370
|
}
|
1092
|
-
|
1093
|
-
key = '' + config.key;
|
371
|
+
return void 0 !== config.ref;
|
1094
372
|
}
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
if (!('key' in config)) {
|
1101
|
-
// If key was not spread in, we can reuse the original props object. This
|
1102
|
-
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
|
1103
|
-
// target and the compiler always passes a new object. For `createElement`,
|
1104
|
-
// we can't assume a new object is passed every time because it can be
|
1105
|
-
// called manually.
|
1106
|
-
//
|
1107
|
-
// Spreading key is a warning in dev. In a future release, we will not
|
1108
|
-
// remove a spread key from the props object. (But we'll still warn.) We'll
|
1109
|
-
// always pass the object straight through.
|
1110
|
-
props = config;
|
1111
|
-
} else {
|
1112
|
-
// We need to remove reserved props (key, prop, ref). Create a fresh props
|
1113
|
-
// object and copy over all the non-reserved props. We don't use `delete`
|
1114
|
-
// because in V8 it will deopt the object to dictionary mode.
|
1115
|
-
props = {};
|
1116
|
-
|
1117
|
-
for (var propName in config) {
|
1118
|
-
// Skip over reserved prop names
|
1119
|
-
if (propName !== 'key' && (enableRefAsProp )) {
|
1120
|
-
{
|
1121
|
-
props[propName] = config[propName];
|
1122
|
-
}
|
1123
|
-
}
|
373
|
+
function hasValidKey(config) {
|
374
|
+
if (hasOwnProperty.call(config, "key")) {
|
375
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
376
|
+
if (getter && getter.isReactWarning) return !1;
|
1124
377
|
}
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
378
|
+
return void 0 !== config.key;
|
379
|
+
}
|
380
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
381
|
+
function warnAboutAccessingKey() {
|
382
|
+
specialPropKeyWarningShown ||
|
383
|
+
((specialPropKeyWarningShown = !0),
|
384
|
+
error(
|
385
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
386
|
+
displayName
|
387
|
+
));
|
1132
388
|
}
|
389
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
390
|
+
Object.defineProperty(props, "key", {
|
391
|
+
get: warnAboutAccessingKey,
|
392
|
+
configurable: !0
|
393
|
+
});
|
1133
394
|
}
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
395
|
+
function elementRefGetterWithDeprecationWarning() {
|
396
|
+
var componentName = getComponentNameFromType(this.type);
|
397
|
+
didWarnAboutElementRef[componentName] ||
|
398
|
+
((didWarnAboutElementRef[componentName] = !0),
|
399
|
+
error(
|
400
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
401
|
+
));
|
402
|
+
componentName = this.props.ref;
|
403
|
+
return void 0 !== componentName ? componentName : null;
|
404
|
+
}
|
405
|
+
function ReactElement(type, key, _ref, self, source, owner, props) {
|
406
|
+
_ref = props.ref;
|
407
|
+
type = {
|
408
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
409
|
+
type: type,
|
410
|
+
key: key,
|
411
|
+
props: props,
|
412
|
+
_owner: owner
|
413
|
+
};
|
414
|
+
null !== (void 0 !== _ref ? _ref : null)
|
415
|
+
? Object.defineProperty(type, "ref", {
|
416
|
+
enumerable: !1,
|
417
|
+
get: elementRefGetterWithDeprecationWarning
|
418
|
+
})
|
419
|
+
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
|
420
|
+
type._store = {};
|
421
|
+
Object.defineProperty(type._store, "validated", {
|
422
|
+
configurable: !1,
|
423
|
+
enumerable: !1,
|
424
|
+
writable: !0,
|
425
|
+
value: 0
|
426
|
+
});
|
427
|
+
Object.defineProperty(type, "_debugInfo", {
|
428
|
+
configurable: !1,
|
429
|
+
enumerable: !1,
|
430
|
+
writable: !0,
|
431
|
+
value: null
|
432
|
+
});
|
433
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
434
|
+
return type;
|
435
|
+
}
|
436
|
+
function jsxDEVImpl(
|
437
|
+
type,
|
438
|
+
config,
|
439
|
+
maybeKey,
|
440
|
+
isStaticChildren,
|
441
|
+
source,
|
442
|
+
self
|
443
|
+
) {
|
444
|
+
if (
|
445
|
+
"string" === typeof type ||
|
446
|
+
"function" === typeof type ||
|
447
|
+
type === REACT_FRAGMENT_TYPE ||
|
448
|
+
type === REACT_PROFILER_TYPE ||
|
449
|
+
type === REACT_STRICT_MODE_TYPE ||
|
450
|
+
type === REACT_SUSPENSE_TYPE ||
|
451
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
452
|
+
type === REACT_OFFSCREEN_TYPE ||
|
453
|
+
("object" === typeof type &&
|
454
|
+
null !== type &&
|
455
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
456
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
457
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
458
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
459
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
460
|
+
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
|
461
|
+
void 0 !== type.getModuleId))
|
462
|
+
) {
|
463
|
+
var children = config.children;
|
464
|
+
if (void 0 !== children)
|
465
|
+
if (isStaticChildren)
|
466
|
+
if (isArrayImpl(children)) {
|
467
|
+
for (
|
468
|
+
isStaticChildren = 0;
|
469
|
+
isStaticChildren < children.length;
|
470
|
+
isStaticChildren++
|
471
|
+
)
|
472
|
+
validateChildKeys(children[isStaticChildren], type);
|
473
|
+
Object.freeze && Object.freeze(children);
|
474
|
+
} else
|
475
|
+
error(
|
476
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
477
|
+
);
|
478
|
+
else validateChildKeys(children, type);
|
479
|
+
} else {
|
480
|
+
children = "";
|
481
|
+
if (
|
482
|
+
void 0 === type ||
|
483
|
+
("object" === typeof type &&
|
484
|
+
null !== type &&
|
485
|
+
0 === Object.keys(type).length)
|
486
|
+
)
|
487
|
+
children +=
|
488
|
+
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
489
|
+
null === type
|
490
|
+
? (isStaticChildren = "null")
|
491
|
+
: isArrayImpl(type)
|
492
|
+
? (isStaticChildren = "array")
|
493
|
+
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
|
494
|
+
? ((isStaticChildren =
|
495
|
+
"<" + (getComponentNameFromType(type.type) || "Unknown") + " />"),
|
496
|
+
(children =
|
497
|
+
" Did you accidentally export a JSX literal instead of a component?"))
|
498
|
+
: (isStaticChildren = typeof type);
|
499
|
+
error(
|
500
|
+
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
501
|
+
isStaticChildren,
|
502
|
+
children
|
503
|
+
);
|
1161
504
|
}
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
505
|
+
if (hasOwnProperty.call(config, "key")) {
|
506
|
+
children = getComponentNameFromType(type);
|
507
|
+
var keys = Object.keys(config).filter(function (k) {
|
508
|
+
return "key" !== k;
|
509
|
+
});
|
510
|
+
isStaticChildren =
|
511
|
+
0 < keys.length
|
512
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
513
|
+
: "{key: someKey}";
|
514
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
515
|
+
((keys =
|
516
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
517
|
+
error(
|
518
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
519
|
+
isStaticChildren,
|
520
|
+
children,
|
521
|
+
keys,
|
522
|
+
children
|
523
|
+
),
|
524
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = !0));
|
1166
525
|
}
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
526
|
+
children = null;
|
527
|
+
void 0 !== maybeKey &&
|
528
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
529
|
+
hasValidKey(config) &&
|
530
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
531
|
+
hasValidRef(config);
|
532
|
+
if ("key" in config) {
|
533
|
+
maybeKey = {};
|
534
|
+
for (var propName in config)
|
535
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
536
|
+
} else maybeKey = config;
|
537
|
+
children &&
|
538
|
+
((config =
|
539
|
+
"function" === typeof type
|
540
|
+
? type.displayName || type.name || "Unknown"
|
541
|
+
: type),
|
542
|
+
children && defineKeyPropWarningGetter(maybeKey, config));
|
543
|
+
return ReactElement(
|
544
|
+
type,
|
545
|
+
children,
|
546
|
+
null,
|
547
|
+
self,
|
548
|
+
source,
|
549
|
+
getOwner(),
|
550
|
+
maybeKey
|
551
|
+
);
|
552
|
+
}
|
553
|
+
function validateChildKeys(node, parentType) {
|
554
|
+
if (
|
555
|
+
"object" === typeof node &&
|
556
|
+
node &&
|
557
|
+
node.$$typeof !== REACT_CLIENT_REFERENCE
|
558
|
+
)
|
559
|
+
if (isArrayImpl(node))
|
560
|
+
for (var i = 0; i < node.length; i++) {
|
561
|
+
var child = node[i];
|
562
|
+
isValidElement(child) && validateExplicitKey(child, parentType);
|
1184
563
|
}
|
1185
|
-
|
564
|
+
else if (isValidElement(node))
|
565
|
+
node._store && (node._store.validated = 1);
|
566
|
+
else if (
|
567
|
+
(null === node || "object" !== typeof node
|
568
|
+
? (i = null)
|
569
|
+
: ((i =
|
570
|
+
(MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
|
571
|
+
node["@@iterator"]),
|
572
|
+
(i = "function" === typeof i ? i : null)),
|
573
|
+
"function" === typeof i &&
|
574
|
+
i !== node.entries &&
|
575
|
+
((i = i.call(node)), i !== node))
|
576
|
+
)
|
577
|
+
for (; !(node = i.next()).done; )
|
578
|
+
isValidElement(node.value) &&
|
579
|
+
validateExplicitKey(node.value, parentType);
|
580
|
+
}
|
581
|
+
function isValidElement(object) {
|
582
|
+
return (
|
583
|
+
"object" === typeof object &&
|
584
|
+
null !== object &&
|
585
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
586
|
+
);
|
587
|
+
}
|
588
|
+
function validateExplicitKey(element, parentType) {
|
589
|
+
if (
|
590
|
+
element._store &&
|
591
|
+
!element._store.validated &&
|
592
|
+
null == element.key &&
|
593
|
+
((element._store.validated = 1),
|
594
|
+
(parentType = getCurrentComponentErrorInfo(parentType)),
|
595
|
+
!ownerHasKeyUseWarning[parentType])
|
596
|
+
) {
|
597
|
+
ownerHasKeyUseWarning[parentType] = !0;
|
598
|
+
var childOwner = "";
|
599
|
+
element &&
|
600
|
+
null != element._owner &&
|
601
|
+
element._owner !== getOwner() &&
|
602
|
+
((childOwner = null),
|
603
|
+
"number" === typeof element._owner.tag
|
604
|
+
? (childOwner = getComponentNameFromType(element._owner.type))
|
605
|
+
: "string" === typeof element._owner.name &&
|
606
|
+
(childOwner = element._owner.name),
|
607
|
+
(childOwner = " It was passed a child from " + childOwner + "."));
|
608
|
+
var prevGetCurrentStack = ReactSharedInternalsServer.getCurrentStack;
|
609
|
+
ReactSharedInternalsServer.getCurrentStack = function () {
|
610
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
611
|
+
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
612
|
+
return stack;
|
613
|
+
};
|
614
|
+
error(
|
615
|
+
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
616
|
+
parentType,
|
617
|
+
childOwner
|
618
|
+
);
|
619
|
+
ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStack;
|
1186
620
|
}
|
1187
621
|
}
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
if (!
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
return
|
622
|
+
function getCurrentComponentErrorInfo(parentType) {
|
623
|
+
var info = "",
|
624
|
+
owner = getOwner();
|
625
|
+
owner &&
|
626
|
+
(owner = getComponentNameFromType(owner.type)) &&
|
627
|
+
(info = "\n\nCheck the render method of `" + owner + "`.");
|
628
|
+
info ||
|
629
|
+
((parentType = getComponentNameFromType(parentType)) &&
|
630
|
+
(info =
|
631
|
+
"\n\nCheck the top-level render call using <" + parentType + ">."));
|
632
|
+
return info;
|
633
|
+
}
|
634
|
+
var React = require("react"),
|
635
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
636
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
637
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
638
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
639
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
640
|
+
Symbol.for("react.provider");
|
641
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
642
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
643
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
644
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
645
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
646
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
647
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
648
|
+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
649
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
650
|
+
ReactSharedInternalsServer =
|
651
|
+
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
652
|
+
if (!ReactSharedInternalsServer)
|
653
|
+
throw Error(
|
654
|
+
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
|
655
|
+
);
|
656
|
+
var REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
|
657
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
658
|
+
assign = Object.assign,
|
659
|
+
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
660
|
+
isArrayImpl = Array.isArray,
|
661
|
+
disabledDepth = 0,
|
662
|
+
prevLog,
|
663
|
+
prevInfo,
|
664
|
+
prevWarn,
|
665
|
+
prevError,
|
666
|
+
prevGroup,
|
667
|
+
prevGroupCollapsed,
|
668
|
+
prevGroupEnd;
|
669
|
+
disabledLog.__reactDisabledLog = !0;
|
670
|
+
var prefix,
|
671
|
+
reentry = !1;
|
672
|
+
var componentFrameCache = new (
|
673
|
+
"function" === typeof WeakMap ? WeakMap : Map
|
674
|
+
)();
|
675
|
+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
676
|
+
specialPropKeyWarningShown;
|
677
|
+
var didWarnAboutElementRef = {};
|
678
|
+
var didWarnAboutKeySpread = {},
|
679
|
+
ownerHasKeyUseWarning = {};
|
680
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
681
|
+
exports.jsx = function (type, config, maybeKey, source, self) {
|
682
|
+
return jsxDEVImpl(type, config, maybeKey, !1, source, self);
|
683
|
+
};
|
684
|
+
exports.jsxDEV = function (
|
685
|
+
type,
|
686
|
+
config,
|
687
|
+
maybeKey,
|
688
|
+
isStaticChildren,
|
689
|
+
source,
|
690
|
+
self
|
691
|
+
) {
|
692
|
+
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
|
693
|
+
};
|
694
|
+
exports.jsxs = function (type, config, maybeKey, source, self) {
|
695
|
+
return jsxDEVImpl(type, config, maybeKey, !0, source, self);
|
1259
696
|
};
|
1260
|
-
|
1261
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
1262
|
-
|
1263
|
-
ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStack;
|
1264
|
-
}
|
1265
|
-
}
|
1266
|
-
|
1267
|
-
function getCurrentComponentErrorInfo(parentType) {
|
1268
|
-
{
|
1269
|
-
var info = '';
|
1270
|
-
var owner = getOwner();
|
1271
|
-
|
1272
|
-
if (owner) {
|
1273
|
-
var name = getComponentNameFromType(owner.type);
|
1274
|
-
|
1275
|
-
if (name) {
|
1276
|
-
info = '\n\nCheck the render method of `' + name + '`.';
|
1277
|
-
}
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
if (!info) {
|
1281
|
-
var parentName = getComponentNameFromType(parentType);
|
1282
|
-
|
1283
|
-
if (parentName) {
|
1284
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
1285
|
-
}
|
1286
|
-
}
|
1287
|
-
|
1288
|
-
return info;
|
1289
|
-
}
|
1290
|
-
}
|
1291
|
-
|
1292
|
-
var jsx = jsxProdSignatureRunningInDevWithDynamicChildren ; // we may want to special case jsxs internally to take advantage of static children.
|
1293
|
-
// for now we can ship identical prod functions
|
1294
|
-
|
1295
|
-
var jsxs = jsxProdSignatureRunningInDevWithStaticChildren ;
|
1296
|
-
var jsxDEV = jsxDEV$1 ;
|
1297
|
-
|
1298
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
1299
|
-
exports.jsx = jsx;
|
1300
|
-
exports.jsxDEV = jsxDEV;
|
1301
|
-
exports.jsxs = jsxs;
|
1302
697
|
})();
|
1303
|
-
}
|