react 19.0.0-rc-38e3b23483-20240529 → 19.0.0-rc-6d3110b4d9-20240531

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.
@@ -20,7 +20,7 @@ if (
20
20
  ) {
21
21
  __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
22
22
  }
23
- var ReactVersion = '19.0.0-rc-38e3b23483-20240529';
23
+ var ReactVersion = '19.0.0-rc-6d3110b4d9-20240531';
24
24
 
25
25
  // -----------------------------------------------------------------------------
26
26
 
@@ -1365,9 +1365,16 @@ function createElement(type, config, children) {
1365
1365
  return ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
1366
1366
  }
1367
1367
  function cloneAndReplaceKey(oldElement, newKey) {
1368
- return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1368
+ var clonedElement = ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1369
1369
  // exists to avoid the `ref` access warning.
1370
1370
  null , undefined, undefined, oldElement._owner, oldElement.props);
1371
+
1372
+ {
1373
+ // The cloned element should inherit the original element's key validation.
1374
+ clonedElement._store.validated = oldElement._store.validated;
1375
+ }
1376
+
1377
+ return clonedElement;
1371
1378
  }
1372
1379
  /**
1373
1380
  * Clone and return a new ReactElement using element as the starting point.
@@ -1797,11 +1804,16 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1797
1804
  ) + '/' : '') + childKey);
1798
1805
 
1799
1806
  {
1800
- if (nameSoFar !== '' && mappedChild.key == null) {
1801
- // We need to validate that this child should have had a key before assigning it one.
1802
- if (!newChild._store.validated) {
1803
- // We mark this child as having failed validation but we let the actual renderer
1804
- // print the warning later.
1807
+ // If `child` was an element without a `key`, we need to validate if
1808
+ // it should have had a `key`, before assigning one to `mappedChild`.
1809
+ // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1810
+ if (nameSoFar !== '' && _child != null && isValidElement(_child) && _child.key == null) {
1811
+ // We check truthiness of `child._store.validated` instead of being
1812
+ // inequal to `1` to provide a bit of backward compatibility for any
1813
+ // libraries (like `fbt`) which may be hacking this property.
1814
+ if (_child._store && !_child._store.validated) {
1815
+ // Mark this child as having failed validation, but let the actual
1816
+ // renderer print the warning later.
1805
1817
  newChild._store.validated = 2;
1806
1818
  }
1807
1819
  }
@@ -2128,6 +2140,7 @@ function forwardRef(render) {
2128
2140
  Object.defineProperty(render, 'name', {
2129
2141
  value: name
2130
2142
  });
2143
+ render.displayName = name;
2131
2144
  }
2132
2145
  }
2133
2146
  });
@@ -2170,6 +2183,7 @@ function memo(type, compare) {
2170
2183
  Object.defineProperty(type, 'name', {
2171
2184
  value: name
2172
2185
  });
2186
+ type.displayName = name;
2173
2187
  }
2174
2188
  }
2175
2189
  });
@@ -536,4 +536,4 @@ exports.useSyncExternalStore = function (
536
536
  exports.useTransition = function () {
537
537
  return ReactSharedInternals.H.useTransition();
538
538
  };
539
- exports.version = "19.0.0-rc-38e3b23483-20240529";
539
+ exports.version = "19.0.0-rc-6d3110b4d9-20240531";
@@ -1122,9 +1122,16 @@ function createElement(type, config, children) {
1122
1122
  return ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
1123
1123
  }
1124
1124
  function cloneAndReplaceKey(oldElement, newKey) {
1125
- return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1125
+ var clonedElement = ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1126
1126
  // exists to avoid the `ref` access warning.
1127
1127
  null , undefined, undefined, oldElement._owner, oldElement.props);
1128
+
1129
+ {
1130
+ // The cloned element should inherit the original element's key validation.
1131
+ clonedElement._store.validated = oldElement._store.validated;
1132
+ }
1133
+
1134
+ return clonedElement;
1128
1135
  }
1129
1136
  /**
1130
1137
  * Clone and return a new ReactElement using element as the starting point.
@@ -1554,11 +1561,16 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1554
1561
  ) + '/' : '') + childKey);
1555
1562
 
1556
1563
  {
1557
- if (nameSoFar !== '' && mappedChild.key == null) {
1558
- // We need to validate that this child should have had a key before assigning it one.
1559
- if (!newChild._store.validated) {
1560
- // We mark this child as having failed validation but we let the actual renderer
1561
- // print the warning later.
1564
+ // If `child` was an element without a `key`, we need to validate if
1565
+ // it should have had a `key`, before assigning one to `mappedChild`.
1566
+ // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1567
+ if (nameSoFar !== '' && _child != null && isValidElement(_child) && _child.key == null) {
1568
+ // We check truthiness of `child._store.validated` instead of being
1569
+ // inequal to `1` to provide a bit of backward compatibility for any
1570
+ // libraries (like `fbt`) which may be hacking this property.
1571
+ if (_child._store && !_child._store.validated) {
1572
+ // Mark this child as having failed validation, but let the actual
1573
+ // renderer print the warning later.
1562
1574
  newChild._store.validated = 2;
1563
1575
  }
1564
1576
  }
@@ -1829,6 +1841,7 @@ function forwardRef(render) {
1829
1841
  Object.defineProperty(render, 'name', {
1830
1842
  value: name
1831
1843
  });
1844
+ render.displayName = name;
1832
1845
  }
1833
1846
  }
1834
1847
  });
@@ -1948,6 +1961,7 @@ function memo(type, compare) {
1948
1961
  Object.defineProperty(type, 'name', {
1949
1962
  value: name
1950
1963
  });
1964
+ type.displayName = name;
1951
1965
  }
1952
1966
  }
1953
1967
  });
@@ -2138,7 +2152,7 @@ function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
2138
2152
 
2139
2153
  function noop() {}
2140
2154
 
2141
- var ReactVersion = '19.0.0-rc-38e3b23483-20240529';
2155
+ var ReactVersion = '19.0.0-rc-6d3110b4d9-20240531';
2142
2156
 
2143
2157
  var Children = {
2144
2158
  map: mapChildren,
@@ -476,4 +476,4 @@ exports.useId = function () {
476
476
  exports.useMemo = function (create, deps) {
477
477
  return ReactSharedInternals.H.useMemo(create, deps);
478
478
  };
479
- exports.version = "19.0.0-rc-38e3b23483-20240529";
479
+ exports.version = "19.0.0-rc-6d3110b4d9-20240531";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "react"
6
6
  ],
7
- "version": "19.0.0-rc-38e3b23483-20240529",
7
+ "version": "19.0.0-rc-6d3110b4d9-20240531",
8
8
  "homepage": "https://react.dev/",
9
9
  "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "MIT",