react 16.14.0 → 17.0.0-rc.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.
- package/build-info.json +5 -5
- package/cjs/react-jsx-dev-runtime.development.js +380 -69
- package/cjs/react-jsx-dev-runtime.production.min.js +2 -2
- package/cjs/react-jsx-dev-runtime.profiling.min.js +9 -0
- package/cjs/react-jsx-runtime.development.js +377 -70
- package/cjs/react-jsx-runtime.production.min.js +2 -2
- package/cjs/react-jsx-runtime.profiling.min.js +10 -0
- package/cjs/react.development.js +801 -383
- package/cjs/react.production.min.js +16 -18
- package/package.json +21 -26
- package/umd/react.development.js +850 -606
- package/umd/react.production.min.js +24 -25
- package/umd/react.profiling.min.js +31 -32
- package/cjs/.DS_Store +0 -0
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "master",
|
|
3
|
+
"buildNumber": "193044",
|
|
4
|
+
"checksum": "38fb0e9",
|
|
5
|
+
"commit": "94c0244ba",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "
|
|
7
|
+
"reactVersion": "17.0.0-alpha.0-94c0244ba"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v17.0.0-rc.0
|
|
2
2
|
* react-jsx-dev-runtime.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -14,6 +14,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
16
|
var React = require('react');
|
|
17
|
+
var _assign = require('object-assign');
|
|
17
18
|
|
|
18
19
|
// ATTENTION
|
|
19
20
|
// When adding new symbols to this file,
|
|
@@ -98,16 +99,7 @@ function printWarning(level, format, args) {
|
|
|
98
99
|
// update consoleWithStackDev.www.js as well.
|
|
99
100
|
{
|
|
100
101
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
101
|
-
var stack =
|
|
102
|
-
|
|
103
|
-
if (currentlyValidatingElement) {
|
|
104
|
-
var name = getComponentName(currentlyValidatingElement.type);
|
|
105
|
-
var owner = currentlyValidatingElement._owner;
|
|
106
|
-
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
stack += ReactDebugCurrentFrame.getStackAddendum();
|
|
110
|
-
|
|
102
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
111
103
|
|
|
112
104
|
if (stack !== '') {
|
|
113
105
|
format += '%s';
|
|
@@ -148,49 +140,16 @@ function isValidElementType(type) {
|
|
|
148
140
|
|
|
149
141
|
return false;
|
|
150
142
|
}
|
|
151
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
152
|
-
function describeComponentFrame (name, source, ownerName) {
|
|
153
|
-
var sourceInfo = '';
|
|
154
|
-
|
|
155
|
-
if (source) {
|
|
156
|
-
var path = source.fileName;
|
|
157
|
-
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
// In DEV, include code for a common special case:
|
|
161
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
162
|
-
if (/^index\./.test(fileName)) {
|
|
163
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
164
|
-
|
|
165
|
-
if (match) {
|
|
166
|
-
var pathBeforeSlash = match[1];
|
|
167
|
-
|
|
168
|
-
if (pathBeforeSlash) {
|
|
169
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
170
|
-
fileName = folderName + '/' + fileName;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
177
|
-
} else if (ownerName) {
|
|
178
|
-
sourceInfo = ' (created by ' + ownerName + ')';
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
var Resolved = 1;
|
|
185
|
-
function refineResolvedLazyComponent(lazyComponent) {
|
|
186
|
-
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
187
|
-
}
|
|
188
143
|
|
|
189
144
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
190
145
|
var functionName = innerType.displayName || innerType.name || '';
|
|
191
146
|
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
192
147
|
}
|
|
193
148
|
|
|
149
|
+
function getContextName(type) {
|
|
150
|
+
return type.displayName || 'Context';
|
|
151
|
+
}
|
|
152
|
+
|
|
194
153
|
function getComponentName(type) {
|
|
195
154
|
if (type == null) {
|
|
196
155
|
// Host root, text node or just invalid type.
|
|
@@ -234,10 +193,12 @@ function getComponentName(type) {
|
|
|
234
193
|
if (typeof type === 'object') {
|
|
235
194
|
switch (type.$$typeof) {
|
|
236
195
|
case REACT_CONTEXT_TYPE:
|
|
237
|
-
|
|
196
|
+
var context = type;
|
|
197
|
+
return getContextName(context) + '.Consumer';
|
|
238
198
|
|
|
239
199
|
case REACT_PROVIDER_TYPE:
|
|
240
|
-
|
|
200
|
+
var provider = type;
|
|
201
|
+
return getContextName(provider._context) + '.Provider';
|
|
241
202
|
|
|
242
203
|
case REACT_FORWARD_REF_TYPE:
|
|
243
204
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
@@ -246,30 +207,375 @@ function getComponentName(type) {
|
|
|
246
207
|
return getComponentName(type.type);
|
|
247
208
|
|
|
248
209
|
case REACT_BLOCK_TYPE:
|
|
249
|
-
return getComponentName(type.
|
|
210
|
+
return getComponentName(type._render);
|
|
250
211
|
|
|
251
212
|
case REACT_LAZY_TYPE:
|
|
252
213
|
{
|
|
253
|
-
var
|
|
254
|
-
var
|
|
214
|
+
var lazyComponent = type;
|
|
215
|
+
var payload = lazyComponent._payload;
|
|
216
|
+
var init = lazyComponent._init;
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
return getComponentName(init(payload));
|
|
220
|
+
} catch (x) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
231
|
+
// replaying on render function. This currently only patches the object
|
|
232
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
233
|
+
// We could also eagerly patch the method.
|
|
234
|
+
var disabledDepth = 0;
|
|
235
|
+
var prevLog;
|
|
236
|
+
var prevInfo;
|
|
237
|
+
var prevWarn;
|
|
238
|
+
var prevError;
|
|
239
|
+
var prevGroup;
|
|
240
|
+
var prevGroupCollapsed;
|
|
241
|
+
var prevGroupEnd;
|
|
242
|
+
|
|
243
|
+
function disabledLog() {}
|
|
244
|
+
|
|
245
|
+
disabledLog.__reactDisabledLog = true;
|
|
246
|
+
function disableLogs() {
|
|
247
|
+
{
|
|
248
|
+
if (disabledDepth === 0) {
|
|
249
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
250
|
+
prevLog = console.log;
|
|
251
|
+
prevInfo = console.info;
|
|
252
|
+
prevWarn = console.warn;
|
|
253
|
+
prevError = console.error;
|
|
254
|
+
prevGroup = console.group;
|
|
255
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
256
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
257
|
+
|
|
258
|
+
var props = {
|
|
259
|
+
configurable: true,
|
|
260
|
+
enumerable: true,
|
|
261
|
+
value: disabledLog,
|
|
262
|
+
writable: true
|
|
263
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
264
|
+
|
|
265
|
+
Object.defineProperties(console, {
|
|
266
|
+
info: props,
|
|
267
|
+
log: props,
|
|
268
|
+
warn: props,
|
|
269
|
+
error: props,
|
|
270
|
+
group: props,
|
|
271
|
+
groupCollapsed: props,
|
|
272
|
+
groupEnd: props
|
|
273
|
+
});
|
|
274
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
disabledDepth++;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function reenableLogs() {
|
|
281
|
+
{
|
|
282
|
+
disabledDepth--;
|
|
283
|
+
|
|
284
|
+
if (disabledDepth === 0) {
|
|
285
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
286
|
+
var props = {
|
|
287
|
+
configurable: true,
|
|
288
|
+
enumerable: true,
|
|
289
|
+
writable: true
|
|
290
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
291
|
+
|
|
292
|
+
Object.defineProperties(console, {
|
|
293
|
+
log: _assign({}, props, {
|
|
294
|
+
value: prevLog
|
|
295
|
+
}),
|
|
296
|
+
info: _assign({}, props, {
|
|
297
|
+
value: prevInfo
|
|
298
|
+
}),
|
|
299
|
+
warn: _assign({}, props, {
|
|
300
|
+
value: prevWarn
|
|
301
|
+
}),
|
|
302
|
+
error: _assign({}, props, {
|
|
303
|
+
value: prevError
|
|
304
|
+
}),
|
|
305
|
+
group: _assign({}, props, {
|
|
306
|
+
value: prevGroup
|
|
307
|
+
}),
|
|
308
|
+
groupCollapsed: _assign({}, props, {
|
|
309
|
+
value: prevGroupCollapsed
|
|
310
|
+
}),
|
|
311
|
+
groupEnd: _assign({}, props, {
|
|
312
|
+
value: prevGroupEnd
|
|
313
|
+
})
|
|
314
|
+
});
|
|
315
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
316
|
+
}
|
|
255
317
|
|
|
256
|
-
|
|
257
|
-
|
|
318
|
+
if (disabledDepth < 0) {
|
|
319
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
325
|
+
var prefix;
|
|
326
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
327
|
+
{
|
|
328
|
+
if (prefix === undefined) {
|
|
329
|
+
// Extract the VM specific prefix used by each line.
|
|
330
|
+
try {
|
|
331
|
+
throw Error();
|
|
332
|
+
} catch (x) {
|
|
333
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
334
|
+
prefix = match && match[1] || '';
|
|
335
|
+
}
|
|
336
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
return '\n' + prefix + name;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
var reentry = false;
|
|
343
|
+
var componentFrameCache;
|
|
344
|
+
|
|
345
|
+
{
|
|
346
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
347
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
351
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
352
|
+
if (!fn || reentry) {
|
|
353
|
+
return '';
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
{
|
|
357
|
+
var frame = componentFrameCache.get(fn);
|
|
358
|
+
|
|
359
|
+
if (frame !== undefined) {
|
|
360
|
+
return frame;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
var control;
|
|
365
|
+
reentry = true;
|
|
366
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
367
|
+
|
|
368
|
+
Error.prepareStackTrace = undefined;
|
|
369
|
+
var previousDispatcher;
|
|
370
|
+
|
|
371
|
+
{
|
|
372
|
+
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
373
|
+
// for warnings.
|
|
374
|
+
|
|
375
|
+
ReactCurrentDispatcher.current = null;
|
|
376
|
+
disableLogs();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
try {
|
|
380
|
+
// This should throw.
|
|
381
|
+
if (construct) {
|
|
382
|
+
// Something should be setting the props in the constructor.
|
|
383
|
+
var Fake = function () {
|
|
384
|
+
throw Error();
|
|
385
|
+
}; // $FlowFixMe
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
389
|
+
set: function () {
|
|
390
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
391
|
+
// because that won't throw in a non-strict mode function.
|
|
392
|
+
throw Error();
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
397
|
+
// We construct a different control for this case to include any extra
|
|
398
|
+
// frames added by the construct call.
|
|
399
|
+
try {
|
|
400
|
+
Reflect.construct(Fake, []);
|
|
401
|
+
} catch (x) {
|
|
402
|
+
control = x;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
Reflect.construct(fn, [], Fake);
|
|
406
|
+
} else {
|
|
407
|
+
try {
|
|
408
|
+
Fake.call();
|
|
409
|
+
} catch (x) {
|
|
410
|
+
control = x;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
fn.call(Fake.prototype);
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
try {
|
|
417
|
+
throw Error();
|
|
418
|
+
} catch (x) {
|
|
419
|
+
control = x;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
fn();
|
|
423
|
+
}
|
|
424
|
+
} catch (sample) {
|
|
425
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
426
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
427
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
428
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
429
|
+
var sampleLines = sample.stack.split('\n');
|
|
430
|
+
var controlLines = control.stack.split('\n');
|
|
431
|
+
var s = sampleLines.length - 1;
|
|
432
|
+
var c = controlLines.length - 1;
|
|
433
|
+
|
|
434
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
435
|
+
// We expect at least one stack frame to be shared.
|
|
436
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
437
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
438
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
439
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
440
|
+
// the sample somewhere in the control.
|
|
441
|
+
c--;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
445
|
+
// Next we find the first one that isn't the same which should be the
|
|
446
|
+
// frame that called our sample function and the control.
|
|
447
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
448
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
449
|
+
// If we're about to return the first line, and the control is also on the same
|
|
450
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
451
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
452
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
453
|
+
if (s !== 1 || c !== 1) {
|
|
454
|
+
do {
|
|
455
|
+
s--;
|
|
456
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
457
|
+
// The next one that isn't the same should be our match though.
|
|
458
|
+
|
|
459
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
460
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
461
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
462
|
+
|
|
463
|
+
{
|
|
464
|
+
if (typeof fn === 'function') {
|
|
465
|
+
componentFrameCache.set(fn, _frame);
|
|
466
|
+
}
|
|
467
|
+
} // Return the line we found.
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
return _frame;
|
|
471
|
+
}
|
|
472
|
+
} while (s >= 1 && c >= 0);
|
|
258
473
|
}
|
|
259
474
|
|
|
260
475
|
break;
|
|
261
476
|
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
} finally {
|
|
480
|
+
reentry = false;
|
|
481
|
+
|
|
482
|
+
{
|
|
483
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
484
|
+
reenableLogs();
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
488
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
492
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
493
|
+
|
|
494
|
+
{
|
|
495
|
+
if (typeof fn === 'function') {
|
|
496
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
262
497
|
}
|
|
263
498
|
}
|
|
264
499
|
|
|
265
|
-
return
|
|
500
|
+
return syntheticFrame;
|
|
266
501
|
}
|
|
502
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
503
|
+
{
|
|
504
|
+
return describeNativeComponentFrame(fn, false);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function shouldConstruct(Component) {
|
|
509
|
+
var prototype = Component.prototype;
|
|
510
|
+
return !!(prototype && prototype.isReactComponent);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
514
|
+
|
|
515
|
+
if (type == null) {
|
|
516
|
+
return '';
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (typeof type === 'function') {
|
|
520
|
+
{
|
|
521
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (typeof type === 'string') {
|
|
526
|
+
return describeBuiltInComponentFrame(type);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
switch (type) {
|
|
530
|
+
case REACT_SUSPENSE_TYPE:
|
|
531
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
532
|
+
|
|
533
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
534
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if (typeof type === 'object') {
|
|
538
|
+
switch (type.$$typeof) {
|
|
539
|
+
case REACT_FORWARD_REF_TYPE:
|
|
540
|
+
return describeFunctionComponentFrame(type.render);
|
|
541
|
+
|
|
542
|
+
case REACT_MEMO_TYPE:
|
|
543
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
544
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
545
|
+
|
|
546
|
+
case REACT_BLOCK_TYPE:
|
|
547
|
+
return describeFunctionComponentFrame(type._render);
|
|
548
|
+
|
|
549
|
+
case REACT_LAZY_TYPE:
|
|
550
|
+
{
|
|
551
|
+
var lazyComponent = type;
|
|
552
|
+
var payload = lazyComponent._payload;
|
|
553
|
+
var init = lazyComponent._init;
|
|
554
|
+
|
|
555
|
+
try {
|
|
556
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
557
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
558
|
+
} catch (x) {}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return '';
|
|
564
|
+
}
|
|
565
|
+
|
|
267
566
|
var loggedTypeFailures = {};
|
|
268
567
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
269
|
-
var currentlyValidatingElement = null;
|
|
270
568
|
|
|
271
569
|
function setCurrentlyValidatingElement(element) {
|
|
272
|
-
|
|
570
|
+
{
|
|
571
|
+
if (element) {
|
|
572
|
+
var owner = element._owner;
|
|
573
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
574
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
575
|
+
} else {
|
|
576
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
273
579
|
}
|
|
274
580
|
|
|
275
581
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
@@ -370,7 +676,7 @@ function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
|
370
676
|
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
371
677
|
|
|
372
678
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
373
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://
|
|
679
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
374
680
|
|
|
375
681
|
didWarnAboutStringRefs[componentName] = true;
|
|
376
682
|
}
|
|
@@ -384,7 +690,7 @@ function defineKeyPropWarningGetter(props, displayName) {
|
|
|
384
690
|
if (!specialPropKeyWarningShown) {
|
|
385
691
|
specialPropKeyWarningShown = true;
|
|
386
692
|
|
|
387
|
-
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://
|
|
693
|
+
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://fb.me/react-special-props)', displayName);
|
|
388
694
|
}
|
|
389
695
|
};
|
|
390
696
|
|
|
@@ -402,7 +708,7 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
402
708
|
if (!specialPropRefWarningShown) {
|
|
403
709
|
specialPropRefWarningShown = true;
|
|
404
710
|
|
|
405
|
-
error('%s: `ref` 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://
|
|
711
|
+
error('%s: `ref` 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://fb.me/react-special-props)', displayName);
|
|
406
712
|
}
|
|
407
713
|
};
|
|
408
714
|
|
|
@@ -559,7 +865,15 @@ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
|
559
865
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
560
866
|
|
|
561
867
|
function setCurrentlyValidatingElement$1(element) {
|
|
562
|
-
|
|
868
|
+
{
|
|
869
|
+
if (element) {
|
|
870
|
+
var owner = element._owner;
|
|
871
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
872
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
873
|
+
} else {
|
|
874
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
563
877
|
}
|
|
564
878
|
|
|
565
879
|
var propTypesMisspellWarningShown;
|
|
@@ -669,7 +983,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
669
983
|
|
|
670
984
|
setCurrentlyValidatingElement$1(element);
|
|
671
985
|
|
|
672
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://
|
|
986
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
673
987
|
|
|
674
988
|
setCurrentlyValidatingElement$1(null);
|
|
675
989
|
}
|
|
@@ -740,6 +1054,7 @@ function validatePropTypes(element) {
|
|
|
740
1054
|
return;
|
|
741
1055
|
}
|
|
742
1056
|
|
|
1057
|
+
var name = getComponentName(type);
|
|
743
1058
|
var propTypes;
|
|
744
1059
|
|
|
745
1060
|
if (typeof type === 'function') {
|
|
@@ -753,15 +1068,11 @@ function validatePropTypes(element) {
|
|
|
753
1068
|
}
|
|
754
1069
|
|
|
755
1070
|
if (propTypes) {
|
|
756
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
757
|
-
var name = getComponentName(type);
|
|
758
1071
|
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
759
1072
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
760
|
-
propTypesMisspellWarningShown = true;
|
|
761
|
-
|
|
762
|
-
var _name = getComponentName(type);
|
|
1073
|
+
propTypesMisspellWarningShown = true;
|
|
763
1074
|
|
|
764
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?',
|
|
1075
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
765
1076
|
}
|
|
766
1077
|
|
|
767
1078
|
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|