@cleartrip/ct-design-ct-react-day-picker 2.6.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1300,6 +1300,7 @@ function requireReactJsxRuntime_development () {
1300
1300
  }
1301
1301
  }
1302
1302
 
1303
+ var didWarnAboutKeySpread = {};
1303
1304
  function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1304
1305
  {
1305
1306
  var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
@@ -1370,6 +1371,24 @@ function requireReactJsxRuntime_development () {
1370
1371
  }
1371
1372
  }
1372
1373
 
1374
+ {
1375
+ if (hasOwnProperty.call(props, 'key')) {
1376
+ var componentName = getComponentNameFromType(type);
1377
+ var keys = Object.keys(props).filter(function (k) {
1378
+ return k !== 'key';
1379
+ });
1380
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1381
+
1382
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1383
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1384
+
1385
+ 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);
1386
+
1387
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
1388
+ }
1389
+ }
1390
+ }
1391
+
1373
1392
  if (type === REACT_FRAGMENT_TYPE) {
1374
1393
  validateFragmentProps(element);
1375
1394
  } else {