react-dom 16.13.0 → 16.13.1

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.
Files changed (28) hide show
  1. package/build-info.json +5 -5
  2. package/cjs/react-dom-server.browser.development.js +2 -2
  3. package/cjs/react-dom-server.browser.production.min.js +2 -2
  4. package/cjs/react-dom-server.node.development.js +2 -2
  5. package/cjs/react-dom-server.node.production.min.js +2 -2
  6. package/cjs/react-dom-test-utils.development.js +1 -1
  7. package/cjs/react-dom-test-utils.production.min.js +1 -1
  8. package/cjs/react-dom-unstable-fizz.browser.development.js +1 -1
  9. package/cjs/react-dom-unstable-fizz.browser.production.min.js +1 -1
  10. package/cjs/react-dom-unstable-fizz.node.development.js +1 -1
  11. package/cjs/react-dom-unstable-fizz.node.production.min.js +1 -1
  12. package/cjs/react-dom-unstable-native-dependencies.development.js +1 -1
  13. package/cjs/react-dom-unstable-native-dependencies.production.min.js +1 -1
  14. package/cjs/react-dom.development.js +389 -423
  15. package/cjs/react-dom.production.min.js +67 -67
  16. package/cjs/react-dom.profiling.min.js +66 -66
  17. package/package.json +3 -3
  18. package/umd/react-dom-server.browser.development.js +2 -2
  19. package/umd/react-dom-server.browser.production.min.js +2 -2
  20. package/umd/react-dom-test-utils.development.js +1 -1
  21. package/umd/react-dom-test-utils.production.min.js +1 -1
  22. package/umd/react-dom-unstable-fizz.browser.development.js +1 -1
  23. package/umd/react-dom-unstable-fizz.browser.production.min.js +1 -1
  24. package/umd/react-dom-unstable-native-dependencies.development.js +1 -1
  25. package/umd/react-dom-unstable-native-dependencies.production.min.js +1 -1
  26. package/umd/react-dom.development.js +389 -423
  27. package/umd/react-dom.production.min.js +52 -52
  28. package/umd/react-dom.profiling.min.js +104 -103
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-dom.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -439,271 +439,6 @@
439
439
  var ScopeComponent = 21;
440
440
  var Block = 22;
441
441
 
442
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
443
- function describeComponentFrame (name, source, ownerName) {
444
- var sourceInfo = '';
445
-
446
- if (source) {
447
- var path = source.fileName;
448
- var fileName = path.replace(BEFORE_SLASH_RE, '');
449
-
450
- {
451
- // In DEV, include code for a common special case:
452
- // prefer "folder/index.js" instead of just "index.js".
453
- if (/^index\./.test(fileName)) {
454
- var match = path.match(BEFORE_SLASH_RE);
455
-
456
- if (match) {
457
- var pathBeforeSlash = match[1];
458
-
459
- if (pathBeforeSlash) {
460
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
461
- fileName = folderName + '/' + fileName;
462
- }
463
- }
464
- }
465
- }
466
-
467
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
468
- } else if (ownerName) {
469
- sourceInfo = ' (created by ' + ownerName + ')';
470
- }
471
-
472
- return '\n in ' + (name || 'Unknown') + sourceInfo;
473
- }
474
-
475
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
476
- // nor polyfill, then a plain number is used for performance.
477
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
478
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
479
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
480
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
481
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
482
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
483
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
484
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
485
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
486
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
487
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
488
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
489
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
490
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
491
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
492
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
493
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
494
- function getIteratorFn(maybeIterable) {
495
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
496
- return null;
497
- }
498
-
499
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
500
-
501
- if (typeof maybeIterator === 'function') {
502
- return maybeIterator;
503
- }
504
-
505
- return null;
506
- }
507
-
508
- var Uninitialized = -1;
509
- var Pending = 0;
510
- var Resolved = 1;
511
- var Rejected = 2;
512
- function refineResolvedLazyComponent(lazyComponent) {
513
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
514
- }
515
- function initializeLazyComponentType(lazyComponent) {
516
- if (lazyComponent._status === Uninitialized) {
517
- lazyComponent._status = Pending;
518
- var ctor = lazyComponent._ctor;
519
- var thenable = ctor();
520
- lazyComponent._result = thenable;
521
- thenable.then(function (moduleObject) {
522
- if (lazyComponent._status === Pending) {
523
- var defaultExport = moduleObject.default;
524
-
525
- {
526
- if (defaultExport === undefined) {
527
- error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
528
- }
529
- }
530
-
531
- lazyComponent._status = Resolved;
532
- lazyComponent._result = defaultExport;
533
- }
534
- }, function (error) {
535
- if (lazyComponent._status === Pending) {
536
- lazyComponent._status = Rejected;
537
- lazyComponent._result = error;
538
- }
539
- });
540
- }
541
- }
542
-
543
- function getWrappedName(outerType, innerType, wrapperName) {
544
- var functionName = innerType.displayName || innerType.name || '';
545
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
546
- }
547
-
548
- function getComponentName(type) {
549
- if (type == null) {
550
- // Host root, text node or just invalid type.
551
- return null;
552
- }
553
-
554
- {
555
- if (typeof type.tag === 'number') {
556
- error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
557
- }
558
- }
559
-
560
- if (typeof type === 'function') {
561
- return type.displayName || type.name || null;
562
- }
563
-
564
- if (typeof type === 'string') {
565
- return type;
566
- }
567
-
568
- switch (type) {
569
- case REACT_FRAGMENT_TYPE:
570
- return 'Fragment';
571
-
572
- case REACT_PORTAL_TYPE:
573
- return 'Portal';
574
-
575
- case REACT_PROFILER_TYPE:
576
- return "Profiler";
577
-
578
- case REACT_STRICT_MODE_TYPE:
579
- return 'StrictMode';
580
-
581
- case REACT_SUSPENSE_TYPE:
582
- return 'Suspense';
583
-
584
- case REACT_SUSPENSE_LIST_TYPE:
585
- return 'SuspenseList';
586
- }
587
-
588
- if (typeof type === 'object') {
589
- switch (type.$$typeof) {
590
- case REACT_CONTEXT_TYPE:
591
- return 'Context.Consumer';
592
-
593
- case REACT_PROVIDER_TYPE:
594
- return 'Context.Provider';
595
-
596
- case REACT_FORWARD_REF_TYPE:
597
- return getWrappedName(type, type.render, 'ForwardRef');
598
-
599
- case REACT_MEMO_TYPE:
600
- return getComponentName(type.type);
601
-
602
- case REACT_BLOCK_TYPE:
603
- return getComponentName(type.render);
604
-
605
- case REACT_LAZY_TYPE:
606
- {
607
- var thenable = type;
608
- var resolvedThenable = refineResolvedLazyComponent(thenable);
609
-
610
- if (resolvedThenable) {
611
- return getComponentName(resolvedThenable);
612
- }
613
-
614
- break;
615
- }
616
- }
617
- }
618
-
619
- return null;
620
- }
621
-
622
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
623
-
624
- function describeFiber(fiber) {
625
- switch (fiber.tag) {
626
- case HostRoot:
627
- case HostPortal:
628
- case HostText:
629
- case Fragment:
630
- case ContextProvider:
631
- case ContextConsumer:
632
- return '';
633
-
634
- default:
635
- var owner = fiber._debugOwner;
636
- var source = fiber._debugSource;
637
- var name = getComponentName(fiber.type);
638
- var ownerName = null;
639
-
640
- if (owner) {
641
- ownerName = getComponentName(owner.type);
642
- }
643
-
644
- return describeComponentFrame(name, source, ownerName);
645
- }
646
- }
647
-
648
- function getStackByFiberInDevAndProd(workInProgress) {
649
- var info = '';
650
- var node = workInProgress;
651
-
652
- do {
653
- info += describeFiber(node);
654
- node = node.return;
655
- } while (node);
656
-
657
- return info;
658
- }
659
- var current = null;
660
- var phase = null;
661
- function getCurrentFiberOwnerNameInDevOrNull() {
662
- {
663
- if (current === null) {
664
- return null;
665
- }
666
-
667
- var owner = current._debugOwner;
668
-
669
- if (owner !== null && typeof owner !== 'undefined') {
670
- return getComponentName(owner.type);
671
- }
672
- }
673
-
674
- return null;
675
- }
676
- function getCurrentFiberStackInDev() {
677
- {
678
- if (current === null) {
679
- return '';
680
- } // Safe because if current fiber exists, we are reconciling,
681
- // and it is guaranteed to be the work-in-progress version.
682
-
683
-
684
- return getStackByFiberInDevAndProd(current);
685
- }
686
- }
687
- function resetCurrentFiber() {
688
- {
689
- ReactDebugCurrentFrame.getCurrentStack = null;
690
- current = null;
691
- phase = null;
692
- }
693
- }
694
- function setCurrentFiber(fiber) {
695
- {
696
- ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
697
- current = fiber;
698
- phase = null;
699
- }
700
- }
701
- function setCurrentPhase(lifeCyclePhase) {
702
- {
703
- phase = lifeCyclePhase;
704
- }
705
- }
706
-
707
442
  /**
708
443
  * Injectable ordering of event plugins.
709
444
  */
@@ -1427,10 +1162,10 @@
1427
1162
  true);
1428
1163
  });
1429
1164
 
1430
- var ReactDebugCurrentFrame$1 = null;
1165
+ var ReactDebugCurrentFrame = null;
1431
1166
 
1432
1167
  {
1433
- ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1168
+ ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1434
1169
  } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
1435
1170
  // and any newline or tab are filtered out as if they're not part of the URL.
1436
1171
  // https://url.spec.whatwg.org/#url-parsing
@@ -1512,127 +1247,392 @@
1512
1247
  // in our config atm.
1513
1248
 
1514
1249
 
1515
- stringValue = node.getAttribute(attributeName);
1250
+ stringValue = node.getAttribute(attributeName);
1251
+ }
1252
+
1253
+ if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1254
+ return stringValue === null ? expected : stringValue;
1255
+ } else if (stringValue === '' + expected) {
1256
+ return expected;
1257
+ } else {
1258
+ return stringValue;
1259
+ }
1260
+ }
1261
+ }
1262
+ }
1263
+ /**
1264
+ * Get the value for a attribute on a node. Only used in DEV for SSR validation.
1265
+ * The third argument is used as a hint of what the expected value is. Some
1266
+ * attributes have multiple equivalent values.
1267
+ */
1268
+
1269
+ function getValueForAttribute(node, name, expected) {
1270
+ {
1271
+ if (!isAttributeNameSafe(name)) {
1272
+ return;
1273
+ }
1274
+
1275
+ if (!node.hasAttribute(name)) {
1276
+ return expected === undefined ? undefined : null;
1277
+ }
1278
+
1279
+ var value = node.getAttribute(name);
1280
+
1281
+ if (value === '' + expected) {
1282
+ return expected;
1283
+ }
1284
+
1285
+ return value;
1286
+ }
1287
+ }
1288
+ /**
1289
+ * Sets the value for a property on a node.
1290
+ *
1291
+ * @param {DOMElement} node
1292
+ * @param {string} name
1293
+ * @param {*} value
1294
+ */
1295
+
1296
+ function setValueForProperty(node, name, value, isCustomComponentTag) {
1297
+ var propertyInfo = getPropertyInfo(name);
1298
+
1299
+ if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
1300
+ return;
1301
+ }
1302
+
1303
+ if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
1304
+ value = null;
1305
+ } // If the prop isn't in the special list, treat it as a simple attribute.
1306
+
1307
+
1308
+ if (isCustomComponentTag || propertyInfo === null) {
1309
+ if (isAttributeNameSafe(name)) {
1310
+ var _attributeName = name;
1311
+
1312
+ if (value === null) {
1313
+ node.removeAttribute(_attributeName);
1314
+ } else {
1315
+ node.setAttribute(_attributeName, '' + value);
1316
+ }
1317
+ }
1318
+
1319
+ return;
1320
+ }
1321
+
1322
+ var mustUseProperty = propertyInfo.mustUseProperty;
1323
+
1324
+ if (mustUseProperty) {
1325
+ var propertyName = propertyInfo.propertyName;
1326
+
1327
+ if (value === null) {
1328
+ var type = propertyInfo.type;
1329
+ node[propertyName] = type === BOOLEAN ? false : '';
1330
+ } else {
1331
+ // Contrary to `setAttribute`, object properties are properly
1332
+ // `toString`ed by IE8/9.
1333
+ node[propertyName] = value;
1334
+ }
1335
+
1336
+ return;
1337
+ } // The rest are treated as attributes with special cases.
1338
+
1339
+
1340
+ var attributeName = propertyInfo.attributeName,
1341
+ attributeNamespace = propertyInfo.attributeNamespace;
1342
+
1343
+ if (value === null) {
1344
+ node.removeAttribute(attributeName);
1345
+ } else {
1346
+ var _type = propertyInfo.type;
1347
+ var attributeValue;
1348
+
1349
+ if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
1350
+ // If attribute type is boolean, we know for sure it won't be an execution sink
1351
+ // and we won't require Trusted Type here.
1352
+ attributeValue = '';
1353
+ } else {
1354
+ // `setAttribute` with objects becomes only `[object]` in IE8/9,
1355
+ // ('' + value) makes it output the correct toString()-value.
1356
+ {
1357
+ attributeValue = '' + value;
1358
+ }
1359
+
1360
+ if (propertyInfo.sanitizeURL) {
1361
+ sanitizeURL(attributeValue.toString());
1362
+ }
1363
+ }
1364
+
1365
+ if (attributeNamespace) {
1366
+ node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
1367
+ } else {
1368
+ node.setAttribute(attributeName, attributeValue);
1369
+ }
1370
+ }
1371
+ }
1372
+
1373
+ var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
1374
+ function describeComponentFrame (name, source, ownerName) {
1375
+ var sourceInfo = '';
1376
+
1377
+ if (source) {
1378
+ var path = source.fileName;
1379
+ var fileName = path.replace(BEFORE_SLASH_RE, '');
1380
+
1381
+ {
1382
+ // In DEV, include code for a common special case:
1383
+ // prefer "folder/index.js" instead of just "index.js".
1384
+ if (/^index\./.test(fileName)) {
1385
+ var match = path.match(BEFORE_SLASH_RE);
1386
+
1387
+ if (match) {
1388
+ var pathBeforeSlash = match[1];
1389
+
1390
+ if (pathBeforeSlash) {
1391
+ var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
1392
+ fileName = folderName + '/' + fileName;
1393
+ }
1394
+ }
1395
+ }
1396
+ }
1397
+
1398
+ sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
1399
+ } else if (ownerName) {
1400
+ sourceInfo = ' (created by ' + ownerName + ')';
1401
+ }
1402
+
1403
+ return '\n in ' + (name || 'Unknown') + sourceInfo;
1404
+ }
1405
+
1406
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1407
+ // nor polyfill, then a plain number is used for performance.
1408
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
1409
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
1410
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
1411
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
1412
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
1413
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
1414
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
1415
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
1416
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
1417
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
1418
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
1419
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
1420
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
1421
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
1422
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
1423
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1424
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
1425
+ function getIteratorFn(maybeIterable) {
1426
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
1427
+ return null;
1428
+ }
1429
+
1430
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1431
+
1432
+ if (typeof maybeIterator === 'function') {
1433
+ return maybeIterator;
1434
+ }
1435
+
1436
+ return null;
1437
+ }
1438
+
1439
+ var Uninitialized = -1;
1440
+ var Pending = 0;
1441
+ var Resolved = 1;
1442
+ var Rejected = 2;
1443
+ function refineResolvedLazyComponent(lazyComponent) {
1444
+ return lazyComponent._status === Resolved ? lazyComponent._result : null;
1445
+ }
1446
+ function initializeLazyComponentType(lazyComponent) {
1447
+ if (lazyComponent._status === Uninitialized) {
1448
+ lazyComponent._status = Pending;
1449
+ var ctor = lazyComponent._ctor;
1450
+ var thenable = ctor();
1451
+ lazyComponent._result = thenable;
1452
+ thenable.then(function (moduleObject) {
1453
+ if (lazyComponent._status === Pending) {
1454
+ var defaultExport = moduleObject.default;
1455
+
1456
+ {
1457
+ if (defaultExport === undefined) {
1458
+ error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
1459
+ }
1460
+ }
1461
+
1462
+ lazyComponent._status = Resolved;
1463
+ lazyComponent._result = defaultExport;
1516
1464
  }
1517
-
1518
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1519
- return stringValue === null ? expected : stringValue;
1520
- } else if (stringValue === '' + expected) {
1521
- return expected;
1522
- } else {
1523
- return stringValue;
1465
+ }, function (error) {
1466
+ if (lazyComponent._status === Pending) {
1467
+ lazyComponent._status = Rejected;
1468
+ lazyComponent._result = error;
1524
1469
  }
1525
- }
1470
+ });
1526
1471
  }
1527
1472
  }
1528
- /**
1529
- * Get the value for a attribute on a node. Only used in DEV for SSR validation.
1530
- * The third argument is used as a hint of what the expected value is. Some
1531
- * attributes have multiple equivalent values.
1532
- */
1533
1473
 
1534
- function getValueForAttribute(node, name, expected) {
1474
+ function getWrappedName(outerType, innerType, wrapperName) {
1475
+ var functionName = innerType.displayName || innerType.name || '';
1476
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
1477
+ }
1478
+
1479
+ function getComponentName(type) {
1480
+ if (type == null) {
1481
+ // Host root, text node or just invalid type.
1482
+ return null;
1483
+ }
1484
+
1535
1485
  {
1536
- if (!isAttributeNameSafe(name)) {
1537
- return;
1486
+ if (typeof type.tag === 'number') {
1487
+ error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
1538
1488
  }
1489
+ }
1539
1490
 
1540
- if (!node.hasAttribute(name)) {
1541
- return expected === undefined ? undefined : null;
1542
- }
1491
+ if (typeof type === 'function') {
1492
+ return type.displayName || type.name || null;
1493
+ }
1543
1494
 
1544
- var value = node.getAttribute(name);
1495
+ if (typeof type === 'string') {
1496
+ return type;
1497
+ }
1545
1498
 
1546
- if (value === '' + expected) {
1547
- return expected;
1548
- }
1499
+ switch (type) {
1500
+ case REACT_FRAGMENT_TYPE:
1501
+ return 'Fragment';
1549
1502
 
1550
- return value;
1551
- }
1552
- }
1553
- /**
1554
- * Sets the value for a property on a node.
1555
- *
1556
- * @param {DOMElement} node
1557
- * @param {string} name
1558
- * @param {*} value
1559
- */
1503
+ case REACT_PORTAL_TYPE:
1504
+ return 'Portal';
1560
1505
 
1561
- function setValueForProperty(node, name, value, isCustomComponentTag) {
1562
- var propertyInfo = getPropertyInfo(name);
1506
+ case REACT_PROFILER_TYPE:
1507
+ return "Profiler";
1563
1508
 
1564
- if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
1565
- return;
1509
+ case REACT_STRICT_MODE_TYPE:
1510
+ return 'StrictMode';
1511
+
1512
+ case REACT_SUSPENSE_TYPE:
1513
+ return 'Suspense';
1514
+
1515
+ case REACT_SUSPENSE_LIST_TYPE:
1516
+ return 'SuspenseList';
1566
1517
  }
1567
1518
 
1568
- if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
1569
- value = null;
1570
- } // If the prop isn't in the special list, treat it as a simple attribute.
1519
+ if (typeof type === 'object') {
1520
+ switch (type.$$typeof) {
1521
+ case REACT_CONTEXT_TYPE:
1522
+ return 'Context.Consumer';
1571
1523
 
1524
+ case REACT_PROVIDER_TYPE:
1525
+ return 'Context.Provider';
1572
1526
 
1573
- if (isCustomComponentTag || propertyInfo === null) {
1574
- if (isAttributeNameSafe(name)) {
1575
- var _attributeName = name;
1527
+ case REACT_FORWARD_REF_TYPE:
1528
+ return getWrappedName(type, type.render, 'ForwardRef');
1576
1529
 
1577
- if (value === null) {
1578
- node.removeAttribute(_attributeName);
1579
- } else {
1580
- node.setAttribute(_attributeName, '' + value);
1581
- }
1582
- }
1530
+ case REACT_MEMO_TYPE:
1531
+ return getComponentName(type.type);
1583
1532
 
1584
- return;
1585
- }
1533
+ case REACT_BLOCK_TYPE:
1534
+ return getComponentName(type.render);
1586
1535
 
1587
- var mustUseProperty = propertyInfo.mustUseProperty;
1536
+ case REACT_LAZY_TYPE:
1537
+ {
1538
+ var thenable = type;
1539
+ var resolvedThenable = refineResolvedLazyComponent(thenable);
1588
1540
 
1589
- if (mustUseProperty) {
1590
- var propertyName = propertyInfo.propertyName;
1541
+ if (resolvedThenable) {
1542
+ return getComponentName(resolvedThenable);
1543
+ }
1591
1544
 
1592
- if (value === null) {
1593
- var type = propertyInfo.type;
1594
- node[propertyName] = type === BOOLEAN ? false : '';
1595
- } else {
1596
- // Contrary to `setAttribute`, object properties are properly
1597
- // `toString`ed by IE8/9.
1598
- node[propertyName] = value;
1545
+ break;
1546
+ }
1599
1547
  }
1548
+ }
1600
1549
 
1601
- return;
1602
- } // The rest are treated as attributes with special cases.
1550
+ return null;
1551
+ }
1603
1552
 
1553
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1604
1554
 
1605
- var attributeName = propertyInfo.attributeName,
1606
- attributeNamespace = propertyInfo.attributeNamespace;
1555
+ function describeFiber(fiber) {
1556
+ switch (fiber.tag) {
1557
+ case HostRoot:
1558
+ case HostPortal:
1559
+ case HostText:
1560
+ case Fragment:
1561
+ case ContextProvider:
1562
+ case ContextConsumer:
1563
+ return '';
1607
1564
 
1608
- if (value === null) {
1609
- node.removeAttribute(attributeName);
1610
- } else {
1611
- var _type = propertyInfo.type;
1612
- var attributeValue;
1565
+ default:
1566
+ var owner = fiber._debugOwner;
1567
+ var source = fiber._debugSource;
1568
+ var name = getComponentName(fiber.type);
1569
+ var ownerName = null;
1613
1570
 
1614
- if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
1615
- // If attribute type is boolean, we know for sure it won't be an execution sink
1616
- // and we won't require Trusted Type here.
1617
- attributeValue = '';
1618
- } else {
1619
- // `setAttribute` with objects becomes only `[object]` in IE8/9,
1620
- // ('' + value) makes it output the correct toString()-value.
1621
- {
1622
- attributeValue = '' + value;
1571
+ if (owner) {
1572
+ ownerName = getComponentName(owner.type);
1623
1573
  }
1624
1574
 
1625
- if (propertyInfo.sanitizeURL) {
1626
- sanitizeURL(attributeValue.toString());
1627
- }
1575
+ return describeComponentFrame(name, source, ownerName);
1576
+ }
1577
+ }
1578
+
1579
+ function getStackByFiberInDevAndProd(workInProgress) {
1580
+ var info = '';
1581
+ var node = workInProgress;
1582
+
1583
+ do {
1584
+ info += describeFiber(node);
1585
+ node = node.return;
1586
+ } while (node);
1587
+
1588
+ return info;
1589
+ }
1590
+ var current = null;
1591
+ var isRendering = false;
1592
+ function getCurrentFiberOwnerNameInDevOrNull() {
1593
+ {
1594
+ if (current === null) {
1595
+ return null;
1628
1596
  }
1629
1597
 
1630
- if (attributeNamespace) {
1631
- node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
1632
- } else {
1633
- node.setAttribute(attributeName, attributeValue);
1598
+ var owner = current._debugOwner;
1599
+
1600
+ if (owner !== null && typeof owner !== 'undefined') {
1601
+ return getComponentName(owner.type);
1634
1602
  }
1635
1603
  }
1604
+
1605
+ return null;
1606
+ }
1607
+ function getCurrentFiberStackInDev() {
1608
+ {
1609
+ if (current === null) {
1610
+ return '';
1611
+ } // Safe because if current fiber exists, we are reconciling,
1612
+ // and it is guaranteed to be the work-in-progress version.
1613
+
1614
+
1615
+ return getStackByFiberInDevAndProd(current);
1616
+ }
1617
+ }
1618
+ function resetCurrentFiber() {
1619
+ {
1620
+ ReactDebugCurrentFrame$1.getCurrentStack = null;
1621
+ current = null;
1622
+ isRendering = false;
1623
+ }
1624
+ }
1625
+ function setCurrentFiber(fiber) {
1626
+ {
1627
+ ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;
1628
+ current = fiber;
1629
+ isRendering = false;
1630
+ }
1631
+ }
1632
+ function setIsRendering(rendering) {
1633
+ {
1634
+ isRendering = rendering;
1635
+ }
1636
1636
  }
1637
1637
 
1638
1638
  // Flow does not allow string concatenation of most non-string types. To work
@@ -5743,7 +5743,6 @@
5743
5743
  }
5744
5744
 
5745
5745
  var didWarnInvalidHydration = false;
5746
- var didWarnShadyDOM = false;
5747
5746
  var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
5748
5747
  var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
5749
5748
  var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
@@ -6063,12 +6062,6 @@
6063
6062
 
6064
6063
  {
6065
6064
  validatePropertiesInDevelopment(tag, rawProps);
6066
-
6067
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
6068
- error('%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
6069
-
6070
- didWarnShadyDOM = true;
6071
- }
6072
6065
  } // TODO: Make sure that we check isMounted before firing any of these events.
6073
6066
 
6074
6067
 
@@ -6422,12 +6415,6 @@
6422
6415
  suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
6423
6416
  isCustomComponentTag = isCustomComponent(tag, rawProps);
6424
6417
  validatePropertiesInDevelopment(tag, rawProps);
6425
-
6426
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
6427
- error('%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
6428
-
6429
- didWarnShadyDOM = true;
6430
- }
6431
6418
  } // TODO: Make sure that we check isMounted before firing any of these events.
6432
6419
 
6433
6420
 
@@ -10948,19 +10935,10 @@
10948
10935
  }
10949
10936
 
10950
10937
  var childContext;
10951
-
10952
- {
10953
- setCurrentPhase('getChildContext');
10954
- }
10955
-
10956
10938
  startPhaseTimer(fiber, 'getChildContext');
10957
10939
  childContext = instance.getChildContext();
10958
10940
  stopPhaseTimer();
10959
10941
 
10960
- {
10961
- setCurrentPhase(null);
10962
- }
10963
-
10964
10942
  for (var contextKey in childContext) {
10965
10943
  if (!(contextKey in childContextTypes)) {
10966
10944
  {
@@ -16896,7 +16874,6 @@
16896
16874
  var didWarnAboutGetDerivedStateOnFunctionComponent;
16897
16875
  var didWarnAboutFunctionRefs;
16898
16876
  var didWarnAboutReassigningProps;
16899
- var didWarnAboutMaxDuration;
16900
16877
  var didWarnAboutRevealOrder;
16901
16878
  var didWarnAboutTailOptions;
16902
16879
 
@@ -16907,7 +16884,6 @@
16907
16884
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
16908
16885
  didWarnAboutFunctionRefs = {};
16909
16886
  didWarnAboutReassigningProps = false;
16910
- didWarnAboutMaxDuration = false;
16911
16887
  didWarnAboutRevealOrder = {};
16912
16888
  didWarnAboutTailOptions = {};
16913
16889
  }
@@ -16971,7 +16947,7 @@
16971
16947
 
16972
16948
  {
16973
16949
  ReactCurrentOwner$1.current = workInProgress;
16974
- setCurrentPhase('render');
16950
+ setIsRendering(true);
16975
16951
  nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
16976
16952
 
16977
16953
  if ( workInProgress.mode & StrictMode) {
@@ -16981,7 +16957,7 @@
16981
16957
  }
16982
16958
  }
16983
16959
 
16984
- setCurrentPhase(null);
16960
+ setIsRendering(false);
16985
16961
  }
16986
16962
 
16987
16963
  if (current !== null && !didReceiveUpdate) {
@@ -17189,7 +17165,7 @@
17189
17165
 
17190
17166
  {
17191
17167
  ReactCurrentOwner$1.current = workInProgress;
17192
- setCurrentPhase('render');
17168
+ setIsRendering(true);
17193
17169
  nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
17194
17170
 
17195
17171
  if ( workInProgress.mode & StrictMode) {
@@ -17199,7 +17175,7 @@
17199
17175
  }
17200
17176
  }
17201
17177
 
17202
- setCurrentPhase(null);
17178
+ setIsRendering(false);
17203
17179
  }
17204
17180
 
17205
17181
  if (current !== null && !didReceiveUpdate) {
@@ -17315,14 +17291,14 @@
17315
17291
  }
17316
17292
  } else {
17317
17293
  {
17318
- setCurrentPhase('render');
17294
+ setIsRendering(true);
17319
17295
  nextChildren = instance.render();
17320
17296
 
17321
17297
  if ( workInProgress.mode & StrictMode) {
17322
17298
  instance.render();
17323
17299
  }
17324
17300
 
17325
- setCurrentPhase(null);
17301
+ setIsRendering(false);
17326
17302
  }
17327
17303
  } // React DevTools reads this flag.
17328
17304
 
@@ -17636,8 +17612,10 @@
17636
17612
  ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
17637
17613
  }
17638
17614
 
17615
+ setIsRendering(true);
17639
17616
  ReactCurrentOwner$1.current = workInProgress;
17640
17617
  value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
17618
+ setIsRendering(false);
17641
17619
  } // React DevTools reads this flag.
17642
17620
 
17643
17621
 
@@ -17803,17 +17781,7 @@
17803
17781
  }
17804
17782
 
17805
17783
  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
17806
- pushSuspenseContext(workInProgress, suspenseContext);
17807
-
17808
- {
17809
- if ('maxDuration' in nextProps) {
17810
- if (!didWarnAboutMaxDuration) {
17811
- didWarnAboutMaxDuration = true;
17812
-
17813
- error('maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
17814
- }
17815
- }
17816
- } // This next part is a bit confusing. If the children timeout, we switch to
17784
+ pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to
17817
17785
  // showing the fallback children in place of the "primary" children.
17818
17786
  // However, we don't want to delete the primary children because then their
17819
17787
  // state will be lost (both the React state and the host state, e.g.
@@ -17835,7 +17803,6 @@
17835
17803
  // custom reconciliation logic to preserve the state of the primary
17836
17804
  // children. It's essentially a very basic form of re-parenting.
17837
17805
 
17838
-
17839
17806
  if (current === null) {
17840
17807
  // If we're currently hydrating, try to hydrate this boundary.
17841
17808
  // But only if this has a fallback.
@@ -18468,9 +18435,9 @@
18468
18435
 
18469
18436
  {
18470
18437
  ReactCurrentOwner$1.current = workInProgress;
18471
- setCurrentPhase('render');
18438
+ setIsRendering(true);
18472
18439
  newChildren = render(newValue);
18473
- setCurrentPhase(null);
18440
+ setIsRendering(false);
18474
18441
  } // React DevTools reads this flag.
18475
18442
 
18476
18443
 
@@ -20982,9 +20949,11 @@
20982
20949
  var currentSource = sourceFiber.alternate;
20983
20950
 
20984
20951
  if (currentSource) {
20952
+ sourceFiber.updateQueue = currentSource.updateQueue;
20985
20953
  sourceFiber.memoizedState = currentSource.memoizedState;
20986
20954
  sourceFiber.expirationTime = currentSource.expirationTime;
20987
20955
  } else {
20956
+ sourceFiber.updateQueue = null;
20988
20957
  sourceFiber.memoizedState = null;
20989
20958
  }
20990
20959
  }
@@ -23382,43 +23351,40 @@
23382
23351
  }
23383
23352
 
23384
23353
  var didWarnAboutUpdateInRender = false;
23385
- var didWarnAboutUpdateInGetChildContext = false;
23354
+ var didWarnAboutUpdateInRenderForAnotherComponent;
23355
+
23356
+ {
23357
+ didWarnAboutUpdateInRenderForAnotherComponent = new Set();
23358
+ }
23386
23359
 
23387
23360
  function warnAboutRenderPhaseUpdatesInDEV(fiber) {
23388
23361
  {
23389
- if ((executionContext & RenderContext) !== NoContext) {
23362
+ if (isRendering && (executionContext & RenderContext) !== NoContext) {
23390
23363
  switch (fiber.tag) {
23391
23364
  case FunctionComponent:
23392
23365
  case ForwardRef:
23393
23366
  case SimpleMemoComponent:
23394
23367
  {
23395
- error('Cannot update a component from inside the function body of a ' + 'different component.');
23368
+ var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.
23369
+
23370
+ var dedupeKey = renderingComponentName;
23371
+
23372
+ if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
23373
+ didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
23374
+ var setStateComponentName = getComponentName(fiber.type) || 'Unknown';
23375
+
23376
+ error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
23377
+ }
23396
23378
 
23397
23379
  break;
23398
23380
  }
23399
23381
 
23400
23382
  case ClassComponent:
23401
23383
  {
23402
- switch (phase) {
23403
- case 'getChildContext':
23404
- if (didWarnAboutUpdateInGetChildContext) {
23405
- return;
23406
- }
23407
-
23408
- error('setState(...): Cannot call setState() inside getChildContext()');
23409
-
23410
- didWarnAboutUpdateInGetChildContext = true;
23411
- break;
23384
+ if (!didWarnAboutUpdateInRender) {
23385
+ error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
23412
23386
 
23413
- case 'render':
23414
- if (didWarnAboutUpdateInRender) {
23415
- return;
23416
- }
23417
-
23418
- error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
23419
-
23420
- didWarnAboutUpdateInRender = true;
23421
- break;
23387
+ didWarnAboutUpdateInRender = true;
23422
23388
  }
23423
23389
 
23424
23390
  break;
@@ -24513,7 +24479,7 @@
24513
24479
  }
24514
24480
 
24515
24481
  {
24516
- if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
24482
+ if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
24517
24483
  didWarnAboutNestedUpdates = true;
24518
24484
 
24519
24485
  error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
@@ -25089,7 +25055,7 @@
25089
25055
  };
25090
25056
  }
25091
25057
 
25092
- var ReactVersion = '16.13.0';
25058
+ var ReactVersion = '16.13.1';
25093
25059
 
25094
25060
  setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
25095
25061
  setAttemptContinuousHydration(attemptContinuousHydration$1);