@cleartrip/ct-design-ct-react-day-picker 2.7.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.js CHANGED
@@ -1302,6 +1302,7 @@ function requireReactJsxRuntime_development () {
1302
1302
  }
1303
1303
  }
1304
1304
 
1305
+ var didWarnAboutKeySpread = {};
1305
1306
  function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1306
1307
  {
1307
1308
  var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
@@ -1372,6 +1373,24 @@ function requireReactJsxRuntime_development () {
1372
1373
  }
1373
1374
  }
1374
1375
 
1376
+ {
1377
+ if (hasOwnProperty.call(props, 'key')) {
1378
+ var componentName = getComponentNameFromType(type);
1379
+ var keys = Object.keys(props).filter(function (k) {
1380
+ return k !== 'key';
1381
+ });
1382
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1383
+
1384
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1385
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1386
+
1387
+ 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);
1388
+
1389
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
1390
+ }
1391
+ }
1392
+ }
1393
+
1375
1394
  if (type === REACT_FRAGMENT_TYPE) {
1376
1395
  validateFragmentProps(element);
1377
1396
  } else {